@@ -4,6 +4,7 @@ import $ from 'jquery';
4
4
import isEqual from 'lodash.isequal' ;
5
5
import { $iq , $msg , $pres , Strophe } from 'strophe.js' ;
6
6
7
+ import { AUTH_ERROR_TYPES } from '../../JitsiConferenceErrors' ;
7
8
import * as JitsiTranscriptionStatus from '../../JitsiTranscriptionStatus' ;
8
9
import { MediaType } from '../../service/RTC/MediaType' ;
9
10
import { VideoType } from '../../service/RTC/VideoType' ;
@@ -1254,11 +1255,14 @@ export default class ChatRoom extends Listenable {
1254
1255
1255
1256
const txtNode = $ ( pres ) . find ( '>error[type="cancel"]>text[xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]' ) ;
1256
1257
const txt = txtNode . length && txtNode . text ( ) ;
1258
+ let type = AUTH_ERROR_TYPES . GENERAL ;
1257
1259
1258
1260
// a race where we have sent a conference request to jicofo and jicofo was about to leave or just left
1259
1261
// because of no participants in the room, and we tried to create the room, without having
1260
1262
// permissions for that (only jicofo creates rooms)
1261
1263
if ( txt === 'Room creation is restricted' ) {
1264
+ type = AUTH_ERROR_TYPES . ROOM_CREATION_RESTRICTION ;
1265
+
1262
1266
if ( ! this . _roomCreationRetries ) {
1263
1267
this . _roomCreationRetries = 0 ;
1264
1268
}
@@ -1275,9 +1279,18 @@ export default class ChatRoom extends Listenable {
1275
1279
1276
1280
return ;
1277
1281
}
1282
+ } else if ( $ ( pres ) . find (
1283
+ '>error[type="cancel"]>no-main-participants[xmlns="jitsi:visitors"]' ) . length > 0 ) {
1284
+ type = AUTH_ERROR_TYPES . NO_MAIN_PARTICIPANTS ;
1285
+ } else if ( $ ( pres ) . find (
1286
+ '>error[type="cancel"]>promotion-not-allowed[xmlns="jitsi:visitors"]' ) . length > 0 ) {
1287
+ type = AUTH_ERROR_TYPES . PROMOTION_NOT_ALLOWED ;
1288
+ } else if ( $ ( pres ) . find (
1289
+ '>error[type="cancel"]>no-visitors-lobby[xmlns="jitsi:visitors"]' ) . length > 0 ) {
1290
+ type = AUTH_ERROR_TYPES . NO_VISITORS_LOBBY ;
1278
1291
}
1279
1292
1280
- this . eventEmitter . emit ( XMPPEvents . ROOM_CONNECT_NOT_ALLOWED_ERROR , txt ) ;
1293
+ this . eventEmitter . emit ( XMPPEvents . ROOM_CONNECT_NOT_ALLOWED_ERROR , type , txt ) ;
1281
1294
}
1282
1295
} else if ( $ ( pres ) . find ( '>error>service-unavailable' ) . length ) {
1283
1296
logger . warn ( 'Maximum users limit for the room has been reached' ,
0 commit comments