فهرست منبع

MUC: Make info messages ephemeral

Otherwise they pollute the history and it's not easy to dedupe them
because they can be created before the MAM history is fetched.
JC Brand 3 سال پیش
والد
کامیت
e4da0f894d
1فایلهای تغییر یافته به همراه1 افزوده شده و 8 حذف شده
  1. 1 8
      src/headless/plugins/muc/muc.js

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

@@ -2397,7 +2397,7 @@ const ChatRoomMixin = {
      */
     createInfoMessage (code, stanza, is_self) {
         const __ = _converse.__;
-        const data = { 'type': 'info' };
+        const data = { 'type': 'info', 'is_ephemeral': true };
         if (!_converse.isInfoVisible(code)) {
             return;
         }
@@ -2425,13 +2425,6 @@ const ChatRoomMixin = {
         if (data.message) {
             if (code === '201' && this.messages.findWhere(data)) {
                 return;
-            } else if (
-                code in _converse.muc.info_messages &&
-                this.messages.length &&
-                this.messages.pop().get('message') === data.message
-            ) {
-                // XXX: very naive duplication checking
-                return;
             }
             this.createMessage(data);
         }