浏览代码

fix: Reads lobby jid from correct location in the error. (#1830)

* fix: Reads lobby jid from correct location in the error.

* squash: Add todo comment.
dev1
Дамян Минков 3 年前
父节点
当前提交
a874f0f092
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 9 次插入1 次删除
  1. 9
    1
      modules/xmpp/ChatRoom.js

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

@@ -1188,11 +1188,19 @@ export default class ChatRoom extends Listenable {
1188 1188
                 + 'xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]').length) {
1189 1189
 
1190 1190
             // let's extract the lobby jid from the custom field
1191
-            const lobbyRoomNode = $(pres).find('>lobbyroom');
1191
+            const lobbyRoomNode = $(pres).find('>error[type="auth"]>lobbyroom');
1192 1192
             let lobbyRoomJid;
1193 1193
 
1194 1194
             if (lobbyRoomNode.length) {
1195 1195
                 lobbyRoomJid = lobbyRoomNode.text();
1196
+            } else {
1197
+                // let's fallback to old location of lobbyroom node, TODO: to be removed in the future once
1198
+                // everything is updated
1199
+                const lobbyRoomOldNode = $(pres).find('>lobbyroom');
1200
+
1201
+                if (lobbyRoomOldNode.length) {
1202
+                    lobbyRoomJid = lobbyRoomOldNode.text();
1203
+                }
1196 1204
             }
1197 1205
 
1198 1206
             this.eventEmitter.emit(XMPPEvents.ROOM_CONNECT_MEMBERS_ONLY_ERROR, lobbyRoomJid);

正在加载...
取消
保存