瀏覽代碼

Adds not allowed errors and handling it.

master
damencho 8 年之前
父節點
當前提交
31d22ef5b4
共有 4 個檔案被更改,包括 10 行新增1 行删除
  1. 5
    0
      JitsiConferenceErrors.js
  2. 3
    0
      JitsiConferenceEventManager.js
  3. 1
    1
      modules/xmpp/ChatRoom.js
  4. 1
    0
      service/xmpp/XMPPEvents.js

+ 5
- 0
JitsiConferenceErrors.js 查看文件

22
  * Indicates that a connection error occurred when trying to join a conference.
22
  * Indicates that a connection error occurred when trying to join a conference.
23
  */
23
  */
24
 export const CONNECTION_ERROR = "conference.connectionError";
24
 export const CONNECTION_ERROR = "conference.connectionError";
25
+/**
26
+ * Indicates that a connection error is due to not allowed,
27
+ * occurred when trying to join a conference.
28
+ */
29
+export const NOT_ALLOWED_ERROR = "conference.connectionError.notAllowed";
25
 /**
30
 /**
26
  * Indicates that focus error happened.
31
  * Indicates that focus error happened.
27
  */
32
  */

+ 3
- 0
JitsiConferenceEventManager.js 查看文件

118
     this.chatRoomForwarder.forward(XMPPEvents.ROOM_CONNECT_ERROR,
118
     this.chatRoomForwarder.forward(XMPPEvents.ROOM_CONNECT_ERROR,
119
         JitsiConferenceEvents.CONFERENCE_FAILED,
119
         JitsiConferenceEvents.CONFERENCE_FAILED,
120
         JitsiConferenceErrors.CONNECTION_ERROR);
120
         JitsiConferenceErrors.CONNECTION_ERROR);
121
+    this.chatRoomForwarder.forward(XMPPEvents.ROOM_CONNECT_NOT_ALLOWED_ERROR,
122
+        JitsiConferenceEvents.CONFERENCE_FAILED,
123
+        JitsiConferenceErrors.NOT_ALLOWED_ERROR);
121
 
124
 
122
     this.chatRoomForwarder.forward(XMPPEvents.ROOM_MAX_USERS_ERROR,
125
     this.chatRoomForwarder.forward(XMPPEvents.ROOM_MAX_USERS_ERROR,
123
         JitsiConferenceEvents.CONFERENCE_FAILED,
126
         JitsiConferenceEvents.CONFERENCE_FAILED,

+ 1
- 1
modules/xmpp/ChatRoom.js 查看文件

583
 
583
 
584
         } else {
584
         } else {
585
             logger.warn('onPresError ', pres);
585
             logger.warn('onPresError ', pres);
586
-            this.eventEmitter.emit(XMPPEvents.ROOM_CONNECT_ERROR);
586
+            this.eventEmitter.emit(XMPPEvents.ROOM_CONNECT_NOT_ALLOWED_ERROR);
587
         }
587
         }
588
     } else if($(pres).find('>error>service-unavailable').length) {
588
     } else if($(pres).find('>error>service-unavailable').length) {
589
         logger.warn('Maximum users limit for the room has been reached',
589
         logger.warn('Maximum users limit for the room has been reached',

+ 1
- 0
service/xmpp/XMPPEvents.js 查看文件

135
     REMOTE_TRACK_REMOVED: "xmpp.remote_track_removed",
135
     REMOTE_TRACK_REMOVED: "xmpp.remote_track_removed",
136
     RESERVATION_ERROR: "xmpp.room_reservation_error",
136
     RESERVATION_ERROR: "xmpp.room_reservation_error",
137
     ROOM_CONNECT_ERROR: 'xmpp.room_connect_error',
137
     ROOM_CONNECT_ERROR: 'xmpp.room_connect_error',
138
+    ROOM_CONNECT_NOT_ALLOWED_ERROR: 'xmpp.room_connect_error.not_allowed',
138
     ROOM_JOIN_ERROR: 'xmpp.room_join_error',
139
     ROOM_JOIN_ERROR: 'xmpp.room_join_error',
139
     /**
140
     /**
140
      * Indicates that max users limit has been reached.
141
      * Indicates that max users limit has been reached.

Loading…
取消
儲存