From 0a1ebc2487cf3f85f017b93f21088215136342a2 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 24 Apr 2017 22:43:02 +0100 Subject: [PATCH] Don't show for anything that doesn't have a msgtype and body otherwise the server will just reject it anyway Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- .../views/context_menus/MessageContextMenu.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/components/views/context_menus/MessageContextMenu.js b/src/components/views/context_menus/MessageContextMenu.js index 5de8d18d72..002ec5bccc 100644 --- a/src/components/views/context_menus/MessageContextMenu.js +++ b/src/components/views/context_menus/MessageContextMenu.js @@ -151,13 +151,17 @@ module.exports = React.createClass({ ); } - if (this.props.mxEvent.getType() === 'm.room.message' - && this.props.mxEvent.getContent().msgtype !== 'm.bad.encrypted') { - forwardButton = ( -
- Forward Message -
- ); + if (this.props.mxEvent.getType() === 'm.room.message') { + const content = this.props.mxEvent.getContent(); + if (content.msgtype // truthy check msgtype + && content.msgtype !== 'm.bad.encrypted' + && content.hasOwnProperty('body')) { + forwardButton = ( +
+ Forward Message +
+ ); + } } viewSourceButton = (