diff --git a/dist/converse.js b/dist/converse.js index 90b8d4a48..5442e0823 100644 --- a/dist/converse.js +++ b/dist/converse.js @@ -64414,7 +64414,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ date = moment(el.getAttribute('data-isodate')), next_el = el.nextElementSibling; - if (!u.hasClass('chat-msg--action', el) && !u.hasClass('chat-msg--action', previous_el) && previous_el.getAttribute('data-from') === from && date.isBefore(moment(previous_el.getAttribute('data-isodate')).add(10, 'minutes'))) { + if (!u.hasClass('chat-msg--action', el) && !u.hasClass('chat-msg--action', previous_el) && previous_el.getAttribute('data-from') === from && date.isBefore(moment(previous_el.getAttribute('data-isodate')).add(10, 'minutes')) && el.getAttribute('data-encrypted') === previous_el.getAttribute('data-encrypted')) { u.addClass('chat-msg--followup', el); } @@ -64422,7 +64422,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ return; } - if (!u.hasClass('chat-msg--action', 'el') && next_el.getAttribute('data-from') === from && moment(next_el.getAttribute('data-isodate')).isBefore(date.add(10, 'minutes'))) { + if (!u.hasClass('chat-msg--action', 'el') && next_el.getAttribute('data-from') === from && moment(next_el.getAttribute('data-isodate')).isBefore(date.add(10, 'minutes')) && el.getAttribute('data-encrypted') === next_el.getAttribute('data-encrypted')) { u.addClass('chat-msg--followup', next_el); } else { u.removeClass('chat-msg--followup', next_el); @@ -74333,6 +74333,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ key = sizzle(`key[rid="${_converse.omemo_store.get('device_id')}"]`, encrypted).pop(); if (key) { + attrs['is_encrypted'] = true; attrs['encrypted'] = { 'device_id': header.getAttribute('sid'), 'iv': header.querySelector('iv').textContent, @@ -74471,6 +74472,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ __ = _converse.__; if (this.get('omemo_active') && attrs.message) { + attrs['is_encrypted'] = true; const message = this.messages.create(attrs); this.getBundlesAndBuildSessions().then(devices => this.createOMEMOMessageStanza(message, devices)).then(stanza => this.sendMessageStanza(stanza)).catch(e => { this.messages.create({ @@ -81277,12 +81279,14 @@ __p += ' chat-msg--action '; } ; __p += ' ' + __e(o.extra_classes) + -'" data-isodate="' + +'"\n data-isodate="' + __e(o.time) + '" data-msgid="' + __e(o.msgid) + '" data-from="' + __e(o.from) + +'" data-encrypted="' + +__e(o.is_encrypted) + '">\n '; if (o.type !== 'headline' && !o.is_me_message) { ; __p += '\n \n '; @@ -81319,6 +81323,10 @@ __e(o.isodate) + __e(o.pretty_time) + ''; } ; +__p += '\n '; + if (o.is_encrypted) { ; +__p += ''; + } ; __p += '\n \n '; if (!o.is_me_message) { ; __p += '
'; diff --git a/mockup/chatbox.html b/mockup/chatbox.html index 56c3a3411..aaeb45713 100644 --- a/mockup/chatbox.html +++ b/mockup/chatbox.html @@ -134,12 +134,33 @@ Juliet Capulet 15:31 +
O Romeo, Romeo! wherefore art thou Romeo? Deny thy father and refuse thy name; + +
+
+
+
+ +
+ + +
+ +
+ + Juliet Capulet + 15:31 + + +
+
+ Or, if thou wilt not, be but sworn my love, And I'll no longer be a Capulet. diff --git a/src/converse-chatview.js b/src/converse-chatview.js index 0c4e7ff1a..57efcde6a 100644 --- a/src/converse-chatview.js +++ b/src/converse-chatview.js @@ -737,14 +737,16 @@ if (!u.hasClass('chat-msg--action', el) && !u.hasClass('chat-msg--action', previous_el) && previous_el.getAttribute('data-from') === from && - date.isBefore(moment(previous_el.getAttribute('data-isodate')).add(10, 'minutes'))) { + date.isBefore(moment(previous_el.getAttribute('data-isodate')).add(10, 'minutes')) && + el.getAttribute('data-encrypted') === previous_el.getAttribute('data-encrypted')) { u.addClass('chat-msg--followup', el); } if (!next_el) { return; } if (!u.hasClass('chat-msg--action', 'el') && next_el.getAttribute('data-from') === from && - moment(next_el.getAttribute('data-isodate')).isBefore(date.add(10, 'minutes'))) { + moment(next_el.getAttribute('data-isodate')).isBefore(date.add(10, 'minutes')) && + el.getAttribute('data-encrypted') === next_el.getAttribute('data-encrypted')) { u.addClass('chat-msg--followup', next_el); } else { u.removeClass('chat-msg--followup', next_el); diff --git a/src/converse-omemo.js b/src/converse-omemo.js index 4b787e923..840124ce3 100644 --- a/src/converse-omemo.js +++ b/src/converse-omemo.js @@ -286,6 +286,7 @@ header = encrypted.querySelector('header'), key = sizzle(`key[rid="${_converse.omemo_store.get('device_id')}"]`, encrypted).pop(); if (key) { + attrs['is_encrypted'] = true; attrs['encrypted'] = { 'device_id': header.getAttribute('sid'), 'iv': header.querySelector('iv').textContent, @@ -418,6 +419,7 @@ { __ } = _converse; if (this.get('omemo_active') && attrs.message) { + attrs['is_encrypted'] = true; const message = this.messages.create(attrs); this.getBundlesAndBuildSessions() .then(devices => this.createOMEMOMessageStanza(message, devices)) diff --git a/src/templates/message.html b/src/templates/message.html index 0b632a6f4..0430fd44f 100644 --- a/src/templates/message.html +++ b/src/templates/message.html @@ -1,4 +1,5 @@ -
+
{[ if (o.type !== 'headline' && !o.is_me_message) { ]} {[ } ]} @@ -9,6 +10,7 @@ {[o.roles.forEach(function (role) { ]} {{{role}}} {[ }); ]} {[ if (!o.is_me_message) { ]}{[ } ]} + {[ if (o.is_encrypted) { ]}{[ } ]} {[ if (!o.is_me_message) { ]}
{[ } ]} {[ if (o.edited) { ]} {[ } ]}