Bläddra i källkod

fix(xmpp): Moves event local user role changed after muc joined.

dev0
damencho 6 månader sedan
förälder
incheckning
492a3e92ac
1 ändrade filer med 7 tillägg och 6 borttagningar
  1. 7
    6
      modules/xmpp/ChatRoom.js

+ 7
- 6
modules/xmpp/ChatRoom.js Visa fil

@@ -638,12 +638,6 @@ export default class ChatRoom extends Listenable {
638 638
             const newRole
639 639
                 = member.affiliation === 'owner' ? member.role : 'none';
640 640
 
641
-            if (this.role !== newRole) {
642
-                this.role = newRole;
643
-                this.eventEmitter.emit(
644
-                    XMPPEvents.LOCAL_ROLE_CHANGED,
645
-                    this.role);
646
-            }
647 641
             if (!this.joined) {
648 642
                 this.joined = true;
649 643
                 const now = this.connectionTimes['muc.joined']
@@ -677,6 +671,13 @@ export default class ChatRoom extends Listenable {
677 671
                 !this.options.disableDiscoInfo && this.discoRoomInfo();
678 672
             }
679 673
 
674
+            if (this.role !== newRole) {
675
+                this.role = newRole;
676
+                this.eventEmitter.emit(
677
+                    XMPPEvents.LOCAL_ROLE_CHANGED,
678
+                    this.role);
679
+            }
680
+
680 681
             if (xElement && $(xElement).find('>status[code="110"]').length) {
681 682
                 // let's check for some backend forced permissions
682 683
 

Laddar…
Avbryt
Spara