tweak userLeaving and Base
This commit is contained in:
parent
45199cb6eb
commit
010f1c2964
@ -45,7 +45,18 @@ export default function userLeaving(meetingId, userId, connectionId) {
|
|||||||
|
|
||||||
ClientConnections.removeClientConnection(`${meetingId}--${userId}`, connectionId);
|
ClientConnections.removeClientConnection(`${meetingId}--${userId}`, connectionId);
|
||||||
|
|
||||||
const reason = user.loggedOut ? 'logout' : 'disconnection';
|
let reason;
|
||||||
|
|
||||||
|
if (user.loggedOut) {
|
||||||
|
// User explicitly requested logout.
|
||||||
|
reason = 'logout';
|
||||||
|
} else if (user.exitReason) {
|
||||||
|
// User didn't requested logout but exited graciously.
|
||||||
|
reason = user.exitReason;
|
||||||
|
} else {
|
||||||
|
// User didn't exit graciously (disconnection).
|
||||||
|
reason = 'disconnection';
|
||||||
|
}
|
||||||
|
|
||||||
Logger.info(`User '${userId}' is leaving meeting '${meetingId}' reason=${reason}`);
|
Logger.info(`User '${userId}' is leaving meeting '${meetingId}' reason=${reason}`);
|
||||||
RedisPubSub.publishUserMessage(CHANNEL, EVENT_NAME, meetingId, userId, payload);
|
RedisPubSub.publishUserMessage(CHANNEL, EVENT_NAME, meetingId, userId, payload);
|
||||||
|
@ -240,7 +240,7 @@ class Base extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static async setExitReason(reason) {
|
static async setExitReason(reason) {
|
||||||
return makeCall('setExitReason', reason);
|
return await makeCall('setExitReason', reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderByState() {
|
renderByState() {
|
||||||
@ -264,8 +264,10 @@ class Base extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (meetingIsBreakout && (ejected || userRemoved)) {
|
if (meetingIsBreakout && (ejected || userRemoved)) {
|
||||||
Base.setExitReason('removedFromBreakout');
|
Base.setExitReason('removedFromBreakout').finally(() => {
|
||||||
|
Meteor.disconnect();
|
||||||
window.close();
|
window.close();
|
||||||
|
});
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -275,14 +277,15 @@ class Base extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((meetingHasEnded || User?.loggedOut) && meetingIsBreakout) {
|
if ((meetingHasEnded || User?.loggedOut) && meetingIsBreakout) {
|
||||||
if (meetingHasEnded) {
|
const reason = meetingHasEnded ? 'breakoutEnded' : 'logout';
|
||||||
Base.setExitReason('breakoutEnded');
|
Base.setExitReason(reason).finally(() => {
|
||||||
}
|
Meteor.disconnect();
|
||||||
window.close();
|
window.close();
|
||||||
|
});
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((meetingHasEnded && !meetingIsBreakout)) || (codeError && User?.loggedOut)) {
|
if (meetingHasEnded && !meetingIsBreakout) {
|
||||||
Base.setExitReason('meetingEnded');
|
Base.setExitReason('meetingEnded');
|
||||||
return (
|
return (
|
||||||
<MeetingEnded
|
<MeetingEnded
|
||||||
@ -294,12 +297,12 @@ class Base extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (codeError && !meetingHasEnded) {
|
if (codeError && !meetingHasEnded) {
|
||||||
// 680 is set for the codeError when the user requests a logout
|
// 680 is set for the codeError when the user requests a logout.
|
||||||
if (codeError !== '680') {
|
if (codeError !== '680') {
|
||||||
if (codeError === '503') Base.setExitReason('disconnected');
|
Base.setExitReason('error');
|
||||||
else Base.setExitReason('error');
|
|
||||||
return (<ErrorScreen code={codeError} />);
|
return (<ErrorScreen code={codeError} />);
|
||||||
}
|
}
|
||||||
|
Base.setExitReason('logout');
|
||||||
return (<MeetingEnded code={codeError} />);
|
return (<MeetingEnded code={codeError} />);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user