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

89 lines
3.4 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
2015-10-01 00:57:44 +08:00
deskshare:
broadcasting: false
timestamp: null
vw: 0
vh: 0
voice_bridge: null
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
# --------------------------------------------------------------------------------------------
2015-10-01 00:57:44 +08:00
# updates the server side database for deskshare information for a meeting
Meteor.methods
simulatePresenterDeskshareHasStarted: (meetingId, bridge, startedBy) ->
console.log("\n\n\n\n\n\n\nmeeting started")
console.log("started by: #{startedBy}\n\n\n\n\n\n\n")
Meteor.Meetings.update({meetingId: meetingId}, {$set: {
"deskshare.broadcasting": true
"deskshare.timestamp": "now"
"deskshare.vw": null
"deskshare.vh": null
"deskshare.voice_bridge": bridge
"deskshare.startedBy": startedBy
}})
simulatePresenterDeskshareHasEnded: (meetingId, startedBy) ->
console.log "\n\n\n\n\n\n\nmeeting is being ended\n\n\n\n\n\n\n"
Meteor.Meetings.update({meetingId: meetingId}, {$set: {
"deskshare.broadcasting": false
"deskshare.timestamp": "now"
"deskshare.vw": null
"deskshare.vh": null
# "deskshare.voice_bridge": bridge
"deskshare.startedBy": null
2015-10-01 00:57:44 +08:00
}})