Skip to content

Commit

Permalink
Fixes #2235
Browse files Browse the repository at this point in the history
  • Loading branch information
jcbrand committed Sep 18, 2020
1 parent 7330530 commit 0a7dff4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 deletions.
12 changes: 8 additions & 4 deletions src/headless/converse-chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
},
Expand Down Expand Up @@ -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;
}
},

Expand Down
15 changes: 0 additions & 15 deletions src/headless/converse-muc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0a7dff4

Please sign in to comment.