From 8d4356a5b98bdb170036e84215401802b48d804d Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 10 Jul 2019 08:57:00 +0100 Subject: [PATCH] Show anything other than ban/invite -> leave as a kick Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/TextForEvent.js | 5 ++--- src/components/views/elements/MemberEventListSummary.js | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/TextForEvent.js b/src/TextForEvent.js index e3c65e7d08..56598c6e06 100644 --- a/src/TextForEvent.js +++ b/src/TextForEvent.js @@ -100,15 +100,14 @@ function textForMemberEvent(ev) { } } else if (prevContent.membership === "ban") { return _t('%(senderName)s unbanned %(targetName)s.', {senderName, targetName}); - } else if (prevContent.membership === "join") { - return _t('%(senderName)s kicked %(targetName)s.', {senderName, targetName}) + ' ' + reason; } else if (prevContent.membership === "invite") { return _t('%(senderName)s withdrew %(targetName)s\'s invitation.', { senderName, targetName, }) + ' ' + reason; } else { - return _t('%(targetName)s left the room.', {targetName}); + // sender is not target and made the target leave, if not from invite/ban then this is a kick + return _t('%(senderName)s kicked %(targetName)s.', {senderName, targetName}) + ' ' + reason; } } } diff --git a/src/components/views/elements/MemberEventListSummary.js b/src/components/views/elements/MemberEventListSummary.js index 9e48d780a9..6d8b490d98 100644 --- a/src/components/views/elements/MemberEventListSummary.js +++ b/src/components/views/elements/MemberEventListSummary.js @@ -345,8 +345,8 @@ module.exports = React.createClass({ switch (e.mxEvent.getPrevContent().membership) { case 'invite': return 'invite_withdrawal'; case 'ban': return 'unbanned'; - case 'join': return 'kicked'; - default: return 'left'; + // sender is not target and made the target leave, if not from invite/ban then this is a kick + default: return 'kicked'; } default: return null; }