2014-07-03 23:52:43 +08:00
|
|
|
Meteor.methods
|
2014-09-05 00:34:18 +08:00
|
|
|
addMeetingToCollection: (meetingId, name, intendedForRecording, voiceConf, duration) ->
|
2014-07-03 23:52:43 +08:00
|
|
|
#check if the meeting is already in the collection
|
|
|
|
unless Meteor.Meetings.findOne({meetingId: meetingId})?
|
2014-09-05 00:34:18 +08:00
|
|
|
currentlyBeingRecorded = false # defaut value
|
|
|
|
id = Meteor.Meetings.insert(
|
|
|
|
meetingId: meetingId,
|
|
|
|
meetingName: name,
|
|
|
|
intendedForRecording: intendedForRecording,
|
|
|
|
currentlyBeingRecorded: currentlyBeingRecorded,
|
|
|
|
voiceConf: voiceConf,
|
|
|
|
duration: duration)
|
2014-09-04 22:47:32 +08:00
|
|
|
console.log "added meeting _id=[#{id}]:meetingId=[#{meetingId}]:name=[#{name}]:duration=[#{duration}]:voiceConf=[#{voiceConf}].
|
2014-07-08 02:03:33 +08:00
|
|
|
Meetings.size is now #{Meteor.Meetings.find().count()}"
|
2014-07-03 23:52:43 +08:00
|
|
|
|
|
|
|
removeMeetingFromCollection: (meetingId) ->
|
2014-07-04 02:31:32 +08:00
|
|
|
if Meteor.Meetings.findOne({meetingId: meetingId})?
|
|
|
|
if Meteor.Users.find({meetingId: meetingId}).count() isnt 0
|
|
|
|
console.log "\n!!!!!removing a meeting which has active users in it!!!!\n"
|
|
|
|
id = Meteor.Meetings.findOne({meetingId: meetingId})
|
2014-07-04 02:44:05 +08:00
|
|
|
if id?
|
|
|
|
Meteor.Meetings.remove(id._id)
|
2014-07-08 02:03:33 +08:00
|
|
|
console.log "removed from Meetings:#{meetingId} now there are only
|
|
|
|
#{Meteor.Meetings.find().count()} meetings running"
|