bigbluebutton-Github/bigbluebutton-html5/app/server/collection_methods/meetings.coffee

59 lines
2.3 KiB
CoffeeScript
Raw Normal View History

# --------------------------------------------------------------------------------------------
# Private methods on server
# --------------------------------------------------------------------------------------------
@addMeetingToCollection = (meetingId, name, intendedForRecording, voiceConf, duration) ->
#check if the meeting is already in the collection
unless Meteor.Meetings.findOne({meetingId: meetingId})?
entry =
meetingId: meetingId
meetingName: name
intendedForRecording: intendedForRecording
currentlyBeingRecorded: false # defaut value
voiceConf: voiceConf
duration: duration
roomLockSettings:
# by default the lock settings will be disabled on meeting create
disablePrivChat: false
disableCam: false
disableMic: false
2015-04-24 05:09:28 +08:00
lockOnJoin: Meteor.config.lockOnJoin
lockedLayout: false
disablePubChat: false
id = Meteor.Meetings.insert(entry)
Meteor.log.info "added meeting _id=[#{id}]:meetingId=[#{meetingId}]:name=[#{name}]:duration=[#{duration}]:voiceConf=[#{voiceConf}]
roomLockSettings:[#{JSON.stringify entry.roomLockSettings}]."
@clearMeetingsCollection = (meetingId) ->
if meetingId?
Meteor.Meetings.remove({meetingId: meetingId}, Meteor.log.info "cleared Meetings Collection (meetingId: #{meetingId}!")
else
Meteor.Meetings.remove({}, Meteor.log.info "cleared Meetings Collection (all meetings)!")
#clean up upon a meeting's end
@removeMeetingFromCollection = (meetingId) ->
if Meteor.Meetings.findOne({meetingId: meetingId})?
2014-12-23 03:53:46 +08:00
Meteor.log.info "end of meeting #{meetingId}. Clear the meeting data from all collections"
# delete all users in the meeting
2014-12-23 03:53:46 +08:00
clearUsersCollection(meetingId)
# delete all slides in the meeting
clearSlidesCollection(meetingId)
# delete all shapes in the meeting
clearShapesCollection(meetingId)
# delete all presentations in the meeting
clearPresentationsCollection(meetingId)
# delete all chat messages in the meeting
clearChatCollection(meetingId)
# delete the meeting
clearMeetingsCollection(meetingId)
2014-10-01 01:02:36 +08:00
# --------------------------------------------------------------------------------------------
# end Private methods on server
# --------------------------------------------------------------------------------------------