Skip to content

Commit 9e9ce38

Browse files
committed
feat(visitors): Handles visitors-supported received from jicofo.
The value is passed to max occupants failure so we can take action on it.
1 parent c29ce29 commit 9e9ce38

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

modules/xmpp/ChatRoom.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1586,7 +1586,9 @@ export default class ChatRoom extends Listenable {
15861586
} else if ($(pres).find('>error>service-unavailable').length) {
15871587
logger.warn('Maximum users limit for the room has been reached',
15881588
pres);
1589-
this.eventEmitter.emit(XMPPEvents.ROOM_MAX_USERS_ERROR);
1589+
this.eventEmitter.emit(XMPPEvents.ROOM_MAX_USERS_ERROR, {
1590+
visitorsSupported: this.xmpp.moderator.visitorsSupported
1591+
});
15901592
} else if ($(pres)
15911593
.find(
15921594
'>error[type="auth"]'

modules/xmpp/moderator.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ export default class Moderator extends Listenable {
5858
// availability.
5959
this.sipGatewayEnabled = false;
6060

61+
// Response to conference request may contain whether visitors are supported
62+
// in certain cases we need to know this to be able to get decisions on some errors (max-occupants reached)
63+
this.visitorsSupported = false;
64+
6165
this.xmpp = xmpp;
6266
this.connection = xmpp.connection;
6367

@@ -413,6 +417,8 @@ export default class Moderator extends Listenable {
413417
return;
414418
}
415419

420+
this.visitorsSupported = conferenceRequest.properties['visitors-supported'];
421+
416422
if (conferenceRequest.ready) {
417423
// Reset the non-error timeout (because we've succeeded here).
418424
this.getNextTimeout(true);

0 commit comments

Comments
 (0)