Bläddra i källkod

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 år sedan
förälder
incheckning
a874f0f092
Inget konto är kopplat till bidragsgivarens mejladress
1 ändrade filer med 9 tillägg och 1 borttagningar
  1. 9
    1
      modules/xmpp/ChatRoom.js

+ 9
- 1
modules/xmpp/ChatRoom.js Visa fil

1188
                 + 'xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]').length) {
1188
                 + 'xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"]').length) {
1189
 
1189
 
1190
             // let's extract the lobby jid from the custom field
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
             let lobbyRoomJid;
1192
             let lobbyRoomJid;
1193
 
1193
 
1194
             if (lobbyRoomNode.length) {
1194
             if (lobbyRoomNode.length) {
1195
                 lobbyRoomJid = lobbyRoomNode.text();
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
             this.eventEmitter.emit(XMPPEvents.ROOM_CONNECT_MEMBERS_ONLY_ERROR, lobbyRoomJid);
1206
             this.eventEmitter.emit(XMPPEvents.ROOM_CONNECT_MEMBERS_ONLY_ERROR, lobbyRoomJid);

Laddar…
Avbryt
Spara