Inform akka that user intentionality logged out from meeting
This commit is contained in:
parent
0105373cee
commit
c9650ba8f1
@ -18,9 +18,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;
|
||||
}
|
||||
@ -32,13 +32,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,
|
||||
};
|
||||
|
||||
ClientConnections.removeClientConnection(`${meetingId}--${userId}`, connectionId);
|
||||
|
@ -20,6 +20,6 @@ export default function userLeftMeeting() { // TODO-- spread the code to method/
|
||||
ClientConnections.removeClientConnection(this.userId, this.connection.id);
|
||||
}
|
||||
} catch (err) {
|
||||
Logger.error(`leaving dummy user to collection: ${err}`);
|
||||
Logger.error(`Error on user left: ${err}`);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user