From f54fcd9035c70e7bbc8d987966b59a1eceb0b58e Mon Sep 17 00:00:00 2001 From: Anton Georgiev Date: Mon, 26 Oct 2015 22:53:34 +0000 Subject: [PATCH 1/2] improve redis log --- bigbluebutton-html5/app/server/redispubsub.coffee | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bigbluebutton-html5/app/server/redispubsub.coffee b/bigbluebutton-html5/app/server/redispubsub.coffee index 76e7715abc..b972ef5ddc 100755 --- a/bigbluebutton-html5/app/server/redispubsub.coffee +++ b/bigbluebutton-html5/app/server/redispubsub.coffee @@ -77,7 +77,7 @@ class Meteor.RedisPubSub if message?.header? and message?.payload? unless message.header.name in notLoggedEventTypes - Meteor.log.info "eventType= #{message.header.name} ", + Meteor.log.info "redis incoming message #{message.header.name} ", message: jsonMsg # handle voice events @@ -287,8 +287,8 @@ class Meteor.RedisPubSub meetingId = message.payload.meeting_id emojiStatus = message.payload.emoji_status if userId? and meetingId? - set_emoji_time = new Date() - Meteor.Users.update({"user.userid": userId},{$set: {"user.set_emoji_time": set_emoji_time, "user.emoji_status": emojiStatus}}) + set_emoji_time = new Date() + Meteor.Users.update({"user.userid": userId},{$set: {"user.set_emoji_time": set_emoji_time, "user.emoji_status": emojiStatus}}) return if message.header.name is "recording_status_changed_message" @@ -370,9 +370,9 @@ class Meteor.RedisPubSub # message should be an object @publish = (channel, message) -> - # Meteor.log.info "Publishing", - # channel: channel - # message: message + Meteor.log.info "redis outgoing message #{message.header.name}", + channel: channel + message: message if Meteor.redisPubSub? Meteor.redisPubSub.pubClient.publish channel, JSON.stringify(message), (err, res) -> From 7d624edbb82f5155ac174bf10b382b9078d7a16e Mon Sep 17 00:00:00 2001 From: Anton Georgiev Date: Mon, 26 Oct 2015 22:54:49 +0000 Subject: [PATCH 2/2] leave global audio when exiting --- .../server/collection_methods/users.coffee | 35 +++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/bigbluebutton-html5/app/server/collection_methods/users.coffee b/bigbluebutton-html5/app/server/collection_methods/users.coffee index 24f1c308e2..56feeb136f 100755 --- a/bigbluebutton-html5/app/server/collection_methods/users.coffee +++ b/bigbluebutton-html5/app/server/collection_methods/users.coffee @@ -143,12 +143,34 @@ Meteor.methods # mark the user as offline. remove from the collection on meeting_end #TODO Meteor.log.info "marking user [#{userId}] as offline in meeting[#{meetingId}]" Meteor.Users.update({'meetingId': meetingId, 'userId': userId}, {$set:{'user.connection_status':'offline'}}) + # result = Meteor.Users.remove({'meetingId': meetingId, 'userId': userId}) + # Meteor.log.error "result on markUserOffline=#{result}" + # Corresponds to a valid action on the HTML clientside # After authorization, publish a user_leaving_request in redis # params: meetingid, userid as defined in BBB-App @requestUserLeaving = (meetingId, userId) -> - if Meteor.Users.findOne({'meetingId': meetingId, 'userId': userId})? + userObject = Meteor.Users.findOne({'meetingId': meetingId, 'userId': userId}) + voiceConf = Meteor.Meetings.findOne({meetingId:meetingId})?.voiceConf + if userObject? and voiceConf? and userId? and meetingId? + + # end listenOnly audio for the departing user + if userObject.user.listenOnly + # Meteor.log.info("~~~~~~~YES, was in listenOnly") + listenOnlyMessage = + payload: + userid: userId + meeting_id: meetingId + voice_conf: voiceConf + name: userObject.user.name + header: + timestamp: new Date().getTime() + name: "user_disconnected_from_global_audio" + + publish Meteor.config.redis.channels.toBBBApps.meeting, listenOnlyMessage + + # remove user from meeting message = payload: meeting_id: meetingId @@ -156,13 +178,12 @@ Meteor.methods header: timestamp: new Date().getTime() name: "user_leaving_request" - version: "0.0.1" - if userId? and meetingId? - Meteor.log.info "sending a user_leaving_request for #{meetingId}:#{userId}" - publish Meteor.config.redis.channels.toBBBApps.users, message - else - Meteor.log.info "did not have enough information to send a user_leaving_request" + Meteor.log.info "sending a user_leaving_request for #{meetingId}:#{userId}" + publish Meteor.config.redis.channels.toBBBApps.users, message + else + Meteor.log.info "did not have enough information to send a user_leaving_request" + #update a voiceUser - a helper method @updateVoiceUser = (meetingId, voiceUserObject) ->