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

Fixes #2235

parent 7330530d
......@@ -179,8 +179,7 @@ converse.plugins.add('converse-chat', {
getMessageText () {
if (this.get('is_encrypted')) {
return this.get('plaintext') ||
(api.settings.get('loglevel') === 'debug' ? __('Unencryptable OMEMO message') : null);
return this.get('plaintext') || this.get('body') || __('Undecryptable OMEMO message');
}
return this.get('message');
},
......@@ -788,11 +787,16 @@ converse.plugins.add('converse-chat', {
getMessageBodyQueryAttrs (attrs) {
if (attrs.message && attrs.msgid) {
return {
'message': attrs.message,
const query = {
'from': attrs.from,
'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', {
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.
* @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