From 187a019eb96625a6ff6788fd3b82cb87bb6371cb Mon Sep 17 00:00:00 2001 From: Joao Siebel Date: Tue, 26 Jan 2021 10:08:54 -0300 Subject: [PATCH] Inform akka that user intentionality logged out from meeting --- .../api/users/server/methods/userLeaving.js | 7 ++++--- .../api/users/server/methods/userLeftMeeting.js | 14 ++------------ 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/bigbluebutton-html5/imports/api/users/server/methods/userLeaving.js b/bigbluebutton-html5/imports/api/users/server/methods/userLeaving.js index a075d36662..9fd6c601fc 100755 --- a/bigbluebutton-html5/imports/api/users/server/methods/userLeaving.js +++ b/bigbluebutton-html5/imports/api/users/server/methods/userLeaving.js @@ -17,9 +17,9 @@ export default function userLeaving(meetingId, userId, connectionId) { userId, }; - const User = Users.findOne(selector); + const user = Users.findOne(selector); - if (!User) { + if (!user) { Logger.info(`Skipping userLeaving. Could not find ${userId} in ${meetingId}`); return; } @@ -31,13 +31,14 @@ export default function userLeaving(meetingId, userId, connectionId) { // If the current user connection is not the same that triggered the leave we skip if (auth?.connectionId !== connectionId) { - Logger.info(`Skipping userLeaving. User connectionId=${User.connectionId} is different from requester connectionId=${connectionId}`); + Logger.info(`Skipping userLeaving. User connectionId=${user.connectionId} is different from requester connectionId=${connectionId}`); return false; } const payload = { userId, sessionId: meetingId, + loggedOut: user.loggedOut, }; Logger.info(`User '${userId}' is leaving meeting '${meetingId}'`); diff --git a/bigbluebutton-html5/imports/api/users/server/methods/userLeftMeeting.js b/bigbluebutton-html5/imports/api/users/server/methods/userLeftMeeting.js index 38e31316ac..6f28a6066a 100644 --- a/bigbluebutton-html5/imports/api/users/server/methods/userLeftMeeting.js +++ b/bigbluebutton-html5/imports/api/users/server/methods/userLeftMeeting.js @@ -17,19 +17,9 @@ export default function userLeftMeeting() { // TODO-- spread the code to method/ if (numberAffected) { Logger.info(`user left id=${requesterUserId} meeting=${meetingId}`); + ClientConnections.removeClientConnection(this.userId, this.connection.id); } - ClientConnections.removeClientConnection(this.userId, this.connection.id); - - Users.update( - selector, - { - $set: { - loggedOut: true, - }, - }, - cb, - ); } catch (err) { - Logger.error(`leaving dummy user to collection: ${err}`); + Logger.error(`Error on user left: ${err}`); } }