瀏覽代碼

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
                 .text()
891
                 .text()
892
             || Strophe.getResourceFromJid(from);
892
             || Strophe.getResourceFromJid(from);
893
 
893
 
894
-        const txt = $(msg).find('>body').text();
895
         const type = msg.getAttribute('type');
894
         const type = msg.getAttribute('type');
896
 
895
 
897
         if (type === 'error') {
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
             return true;
901
             return true;
902
         }
902
         }
903
 
903
 
904
+        const txt = $(msg).find('>body').text();
904
         const subject = $(msg).find('>subject');
905
         const subject = $(msg).find('>subject');
905
 
906
 
906
         if (subject.length) {
907
         if (subject.length) {

Loading…
取消
儲存