2014-09-26 02:47:43 +08:00
|
|
|
# --------------------------------------------------------------------------------------------
|
|
|
|
# Private methods on server
|
|
|
|
# --------------------------------------------------------------------------------------------
|
|
|
|
@addMeetingToCollection = (meetingId, name, intendedForRecording, voiceConf, duration) ->
|
2015-03-31 01:49:30 +08:00
|
|
|
#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
|
2015-03-31 01:49:30 +08:00
|
|
|
lockedLayout: false
|
|
|
|
disablePubChat: false
|
2015-10-01 00:57:44 +08:00
|
|
|
deskshare:
|
|
|
|
broadcasting: false
|
|
|
|
timestamp: null
|
|
|
|
vw: 0
|
|
|
|
vh: 0
|
|
|
|
voice_bridge: null
|
2015-03-31 01:49:30 +08:00
|
|
|
|
|
|
|
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}]."
|
2014-07-03 23:52:43 +08:00
|
|
|
|
2014-12-23 03:43:27 +08:00
|
|
|
|
|
|
|
@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)!")
|
|
|
|
|
2015-03-31 01:49:30 +08:00
|
|
|
#clean up upon a meeting's end
|
2014-09-26 02:47:43 +08:00
|
|
|
@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"
|
2014-12-23 03:43:27 +08:00
|
|
|
# delete all users in the meeting
|
2014-12-23 03:53:46 +08:00
|
|
|
clearUsersCollection(meetingId)
|
2014-12-23 03:43:27 +08:00
|
|
|
|
|
|
|
# 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": startedBy
|
|
|
|
}})
|