Преглед изворни кода

Don't validate message creation

This causes messages to be created but then not populated, causing empty
messages appearing in the chat after page relaod.

Fixes #1886
JC Brand пре 5 година
родитељ
комит
590a8862bc
2 измењених фајлова са 0 додато и 12 уклоњено
  1. 0 8
      src/headless/converse-chat.js
  2. 0 4
      src/headless/converse-muc.js

+ 0 - 8
src/headless/converse-chat.js

@@ -87,10 +87,6 @@ converse.plugins.add('converse-chat', {
 
             async initialize () {
                 this.initialized = u.getResolveablePromise();
-                this.on('invalid', () => {
-                    log.error("Message not created due to validation error!");
-                    log.error(this.toJSON());
-                });
                 if (this.get('type') === 'chat') {
                     ModelWithContact.prototype.initialize.apply(this, arguments);
                     this.setRosterContact(Strophe.getBareJidFromJid(this.get('from')));
@@ -109,10 +105,6 @@ converse.plugins.add('converse-chat', {
                 this.initialized.resolve();
             },
 
-            validate (attrs) {
-                return !u.shouldCreateMessage(attrs);
-            },
-
             /**
              * Sets an auto-destruct timer for this message, if it's is_ephemeral.
              * @private

+ 0 - 4
src/headless/converse-muc.js

@@ -249,10 +249,6 @@ converse.plugins.add('converse-muc', {
                 _converse.api.trigger('chatRoomMessageInitialized', this);
             },
 
-            validate (attrs) {
-                return !u.shouldCreateGroupchatMessage(attrs);
-            },
-
             onOccupantRemoved () {
                 this.stopListening(this.occupant);
                 delete this.occupant;