From 8dc2604d63795fdb215e4f66fe6f05c6b4c9d670 Mon Sep 17 00:00:00 2001 From: turt2live Date: Thu, 14 Sep 2017 09:02:16 -0600 Subject: [PATCH] Show who redacted an event on hover This should fix #3931 although it's not obvious who actually performed the redaction. Signed-off-by: Travis Ralston --- src/components/views/messages/UnknownBody.js | 7 ++++++- src/i18n/strings/en_EN.json | 1 + src/i18n/strings/en_US.json | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/views/messages/UnknownBody.js b/src/components/views/messages/UnknownBody.js index 1b6f6426e5..346d157e24 100644 --- a/src/components/views/messages/UnknownBody.js +++ b/src/components/views/messages/UnknownBody.js @@ -23,9 +23,14 @@ module.exports = React.createClass({ displayName: 'UnknownBody', render: function() { + let tooltip = _t("Removed or unknown message type"); + if (this.props.mxEvent.isRedacted()) { + tooltip = _t("Message removed by %(userId)s", {userId: this.props.mxEvent.getSender()}); + } + const text = this.props.mxEvent.getContent().body; return ( - + {text} ); diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index de0b8e9ebb..22636fceb7 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -827,6 +827,7 @@ "Autocomplete Delay (ms):": "Autocomplete Delay (ms):", "This Home server does not support groups": "This Home server does not support groups", "Loading device info...": "Loading device info...", + "Message removed by %(userId)s": "Message removed by %(userId)s", "Groups": "Groups", "Create a new group": "Create a new group", "Create Group": "Create Group", diff --git a/src/i18n/strings/en_US.json b/src/i18n/strings/en_US.json index dd94a82727..0f58372a88 100644 --- a/src/i18n/strings/en_US.json +++ b/src/i18n/strings/en_US.json @@ -838,6 +838,7 @@ "Autocomplete Delay (ms):": "Autocomplete Delay (ms):", "This Home server does not support groups": "This Home server does not support groups", "Loading device info...": "Loading device info...", + "Message removed by %(userId)s": "Message removed by %(userId)s", "Groups": "Groups", "Create a new group": "Create a new group", "Create Group": "Create Group",