Commit 590a8862 authored by JC Brand's avatar JC Brand

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
parent c7e57936
......@@ -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
......
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment