ソースを参照

Avoids sending presence when kicked and room is left.

dev1
damencho 8年前
コミット
2efb7f64af
1個のファイルの変更5行の追加3行の削除
  1. 5
    3
      modules/xmpp/ChatRoom.js

+ 5
- 3
modules/xmpp/ChatRoom.js ファイルの表示

@@ -495,7 +495,7 @@ ChatRoom.prototype.onPresenceUnavailable = function (pres, from) {
495 495
     }
496 496
     if ($(pres).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>status[code="307"]').length) {
497 497
         if (this.myroomjid === from) {
498
-            this.leave();
498
+            this.leave(true);
499 499
             this.eventEmitter.emit(XMPPEvents.KICKED);
500 500
         }
501 501
     }
@@ -943,13 +943,15 @@ ChatRoom.prototype.onMute = function (iq) {
943 943
 
944 944
 /**
945 945
  * Leaves the room. Closes the jingle session.
946
+ * @parama voidSendingPresence avoids sending the presence when leaving
946 947
  */
947
-ChatRoom.prototype.leave = function () {
948
+ChatRoom.prototype.leave = function (avoidSendingPresence) {
948 949
     if (this.session) {
949 950
         this.session.close();
950 951
     }
951 952
     this.eventEmitter.emit(XMPPEvents.DISPOSE_CONFERENCE);
952
-    this.doLeave();
953
+    if(!avoidSendingPresence)
954
+        this.doLeave();
953 955
     this.connection.emuc.doLeave(this.roomjid);
954 956
 };
955 957
 

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