From ddda435e9e7237b8a923afb68754a584a5973c15 Mon Sep 17 00:00:00 2001 From: wmwragg Date: Thu, 18 Aug 2016 22:15:53 +0100 Subject: [PATCH] Updated the MessagePanel to now take account of /me messages when working out if an event is a continuation message or not --- src/components/structures/MessagePanel.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/components/structures/MessagePanel.js b/src/components/structures/MessagePanel.js index 53efac6406..73ea2fd1a0 100644 --- a/src/components/structures/MessagePanel.js +++ b/src/components/structures/MessagePanel.js @@ -337,6 +337,18 @@ module.exports = React.createClass({ continuation = true; } + // Work out if this is still a continuation, as we are now showing commands + // and /me messages with their own little avatar. The case of a change of + // event type (commands) is handled above, but we need to handle the /me + // messages seperately as they have a msgtype of 'm.emote' but are classed + // as normal messages + if (prevEvent !== null && prevEvent.sender && mxEv.sender + && mxEv.sender.userId === prevEvent.sender.userId + && mxEv.getType() == prevEvent.getType() + && prevEvent.getContent().msgtype === 'm.emote') { + continuation = false; + } + // local echoes have a fake date, which could even be yesterday. Treat them // as 'today' for the date separators. var ts1 = mxEv.getTs();