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

22 lines
777 B
CoffeeScript
Executable File

# --------------------------------------------------------------------------------------------
# Private methods on server
# --------------------------------------------------------------------------------------------
@addPollToCollection = (poll, requester_id, users) ->
_users = []
i = 0
while i < users.length
_users.push users[i].user.userid
i++
entry =
poll_info:
"poll": poll
"requester": requester_id
"users": _users
Meteor.Polls.insert(entry)
@clearPollCollection = (meetingId) ->
if meetingId?
Meteor.Polls.remove({meetingId: meetingId}, Meteor.log.info "cleared Polls Collection (meetingId: #{meetingId}!")
else
Meteor.Polls.remove({}, Meteor.log.info "cleared Polls Collection (all Polls)!")