Переглянути джерело

fix: chat error event

master
Bettenbuk Zoltan 5 роки тому
джерело
коміт
f9808adb8e
1 змінених файлів з 4 додано та 3 видалено
  1. 4
    3
      modules/xmpp/ChatRoom.js

+ 4
- 3
modules/xmpp/ChatRoom.js Переглянути файл

@@ -891,16 +891,17 @@ export default class ChatRoom extends Listenable {
891 891
                 .text()
892 892
             || Strophe.getResourceFromJid(from);
893 893
 
894
-        const txt = $(msg).find('>body').text();
895 894
         const type = msg.getAttribute('type');
896 895
 
897 896
         if (type === 'error') {
898
-            this.eventEmitter.emit(XMPPEvents.CHAT_ERROR_RECEIVED,
899
-                $(msg).find('>text').text(), txt);
897
+            const errorMsg = $(msg).find('>error>text').text();
898
+
899
+            this.eventEmitter.emit(XMPPEvents.CHAT_ERROR_RECEIVED, errorMsg);
900 900
 
901 901
             return true;
902 902
         }
903 903
 
904
+        const txt = $(msg).find('>body').text();
904 905
         const subject = $(msg).find('>subject');
905 906
 
906 907
         if (subject.length) {

Завантаження…
Відмінити
Зберегти