Kaynağa Gözat

Avoids sending presence when kicked and room is left.

dev1
damencho 8 yıl önce
ebeveyn
işleme
2efb7f64af
1 değiştirilmiş dosya ile 5 ekleme ve 3 silme
  1. 5
    3
      modules/xmpp/ChatRoom.js

+ 5
- 3
modules/xmpp/ChatRoom.js Dosyayı Görüntüle

495
     }
495
     }
496
     if ($(pres).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>status[code="307"]').length) {
496
     if ($(pres).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>status[code="307"]').length) {
497
         if (this.myroomjid === from) {
497
         if (this.myroomjid === from) {
498
-            this.leave();
498
+            this.leave(true);
499
             this.eventEmitter.emit(XMPPEvents.KICKED);
499
             this.eventEmitter.emit(XMPPEvents.KICKED);
500
         }
500
         }
501
     }
501
     }
943
 
943
 
944
 /**
944
 /**
945
  * Leaves the room. Closes the jingle session.
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
     if (this.session) {
949
     if (this.session) {
949
         this.session.close();
950
         this.session.close();
950
     }
951
     }
951
     this.eventEmitter.emit(XMPPEvents.DISPOSE_CONFERENCE);
952
     this.eventEmitter.emit(XMPPEvents.DISPOSE_CONFERENCE);
952
-    this.doLeave();
953
+    if(!avoidSendingPresence)
954
+        this.doLeave();
953
     this.connection.emuc.doLeave(this.roomjid);
955
     this.connection.emuc.doLeave(this.roomjid);
954
 };
956
 };
955
 
957
 

Loading…
İptal
Kaydet