From f8d7ab10fab9c742f2351477e698d5f6b0e6a5d1 Mon Sep 17 00:00:00 2001 From: Richard Lewis Date: Wed, 17 Jan 2018 17:19:20 +0000 Subject: [PATCH] Handle non-m.room.message event types. --- src/components/structures/MessagePanel.js | 2 +- src/components/views/rooms/EventTile.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/structures/MessagePanel.js b/src/components/structures/MessagePanel.js index 53cc660a9b..30ded948a4 100644 --- a/src/components/structures/MessagePanel.js +++ b/src/components/structures/MessagePanel.js @@ -450,7 +450,7 @@ module.exports = React.createClass({ if (prevEvent !== null && prevEvent.sender && mxEv.sender && mxEv.sender.userId === prevEvent.sender.userId - && mxEv.getType() == prevEvent.getType()) { + && Boolean(mxEv.getContent().body) == Boolean(prevEvent.getContent().body)) { continuation = true; } diff --git a/src/components/views/rooms/EventTile.js b/src/components/views/rooms/EventTile.js index a6750ac792..3245cf1ac3 100644 --- a/src/components/views/rooms/EventTile.js +++ b/src/components/views/rooms/EventTile.js @@ -440,7 +440,8 @@ module.exports = withMatrixClient(React.createClass({ const eventType = this.props.mxEvent.getType(); // Info messages are basically information about commands processed on a room - const isInfoMessage = (eventType !== 'm.room.message' && eventType !== 'm.room.sticker'); + // For now assume that anything that doesn't have a content body is an isInfoMessage + const isInfoMessage = !content.body; // Boolean comparison of non-boolean content body const EventTileType = sdk.getComponent(getHandlerTile(this.props.mxEvent)); // This shouldn't happen: the caller should check we support this type