ソースを参照

Fix: sysMessageHandler not deleted (#1590)

* Fix: sysMessageHandler not deleted

#1589

* Update xmpp.js
dev1
Christoph Wiechert 4年前
コミット
7565e46df0
コミッターのメールアドレスに関連付けられたアカウントが存在しません
1個のファイルの変更6行の追加2行の削除
  1. 6
    2
      modules/xmpp/xmpp.js

+ 6
- 2
modules/xmpp/xmpp.js ファイルの表示

@@ -281,6 +281,7 @@ export default class XMPP extends Listenable {
281 281
             // once connected or attached we no longer need this handle, drop it if it exist
282 282
             if (this._sysMessageHandler) {
283 283
                 this.connection._stropheConn.deleteHandler(this._sysMessageHandler);
284
+                this._sysMessageHandler = null;
284 285
             }
285 286
 
286 287
             this.sendDiscoInfo && this.connection.jingle.getStunAndTurnCredentials();
@@ -496,8 +497,11 @@ export default class XMPP extends Listenable {
496 497
         this.sendDiscoInfo = true;
497 498
 
498 499
         if (this.connection._stropheConn && this.connection._stropheConn._addSysHandler) {
499
-            this._sysMessageHandler = this._onSystemMessage.bind(this);
500
-            this.connection._stropheConn._addSysHandler(this._sysMessageHandler, null, 'message');
500
+            this._sysMessageHandler = this.connection._stropheConn._addSysHandler(
501
+                this._onSystemMessage.bind(this),
502
+                null,
503
+                'message'
504
+            );
501 505
         } else {
502 506
             logger.warn('Cannot attach strophe system handler, jiconop cannot operate');
503 507
         }

読み込み中…
キャンセル
保存