Commit e6ba62d8 authored by JC Brand's avatar JC Brand

Avoid creating unnecessary messages

parent bbf33a8e
......@@ -449,7 +449,11 @@
* based on the identified message stanza.
*/
const attrs = this.getMessageAttributesFromStanza.apply(this, arguments)
if (u.isOnlyChatStateNotification(attrs)) {
if (u.isOnlyChatStateNotification(attrs) && attrs.delayed) {
// No need showing old CSNs
return;
} else if (!attrs.file && !attrs.message && !attrs.oob_url && attrs.type !== 'error') {
// TODO: handle <subject> messages (currently being done by ChatRoom)
return;
} else {
return this.messages.create(attrs);
......
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