Commit 0a7dff44 authored by JC Brand's avatar JC Brand

Fixes #2235

parent 7330530d
...@@ -179,8 +179,7 @@ converse.plugins.add('converse-chat', { ...@@ -179,8 +179,7 @@ converse.plugins.add('converse-chat', {
getMessageText () { getMessageText () {
if (this.get('is_encrypted')) { if (this.get('is_encrypted')) {
return this.get('plaintext') || return this.get('plaintext') || this.get('body') || __('Undecryptable OMEMO message');
(api.settings.get('loglevel') === 'debug' ? __('Unencryptable OMEMO message') : null);
} }
return this.get('message'); return this.get('message');
}, },
...@@ -788,11 +787,16 @@ converse.plugins.add('converse-chat', { ...@@ -788,11 +787,16 @@ converse.plugins.add('converse-chat', {
getMessageBodyQueryAttrs (attrs) { getMessageBodyQueryAttrs (attrs) {
if (attrs.message && attrs.msgid) { if (attrs.message && attrs.msgid) {
return { const query = {
'message': attrs.message,
'from': attrs.from, 'from': attrs.from,
'msgid': attrs.msgid 'msgid': attrs.msgid
} }
if (!attrs.is_encrypted) {
// We can't match the message if it's a reflected
// encrypted message (e.g. via MAM or in a MUC)
query['message'] = attrs.message;
}
return query;
} }
}, },
......
...@@ -1930,21 +1930,6 @@ converse.plugins.add('converse-muc', { ...@@ -1930,21 +1930,6 @@ converse.plugins.add('converse-muc', {
return false; return false;
}, },
getMessageBodyQueryAttrs (attrs) {
if (attrs.message && attrs.msgid) {
const query = {
'from': attrs.from,
'msgid': attrs.msgid
}
if (!attrs.is_encrypted) {
// We can't match the message if it's a reflected
// encrypted MUC message
query['message'] = attrs.message;
}
return query;
}
},
/** /**
* Queue an incoming message stanza meant for this {@link _converse.Chatroom} for processing. * Queue an incoming message stanza meant for this {@link _converse.Chatroom} for processing.
* @async * @async
......
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