瀏覽代碼

MUC: Wait until occupants are fetched before updating them

JC Brand 4 年之前
父節點
當前提交
7abc81f8a4
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/headless/plugins/muc/muc.js

+ 2 - 1
src/headless/plugins/muc/muc.js

@@ -2300,7 +2300,8 @@ const ChatRoomMixin = {
      * @method _converse.ChatRoom#onOwnPresence
      * @param { XMLElement } pres - The stanza
      */
-    onOwnPresence (stanza) {
+    async onOwnPresence (stanza) {
+        await this.occupants.fetched;
         if (stanza.getAttribute('type') !== 'unavailable') {
             const old_status = this.session.get('connection_status');
             if (old_status !== converse.ROOMSTATUS.ENTERED) {