From 7850c506b78a1e3d76df35b7e5a1c7a6189027a3 Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Fri, 6 Mar 2020 22:17:49 -0600 Subject: [PATCH] When room name is changed, show both the old and new name Signed-off-by: Aaron Raimist --- src/TextForEvent.js | 6 ++++-- src/i18n/strings/en_EN.json | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/TextForEvent.js b/src/TextForEvent.js index d4003058c8..79083e351c 100644 --- a/src/TextForEvent.js +++ b/src/TextForEvent.js @@ -127,9 +127,11 @@ function textForRoomNameEvent(ev) { if (!ev.getContent().name || ev.getContent().name.trim().length === 0) { return _t('%(senderDisplayName)s removed the room name.', {senderDisplayName}); } - return _t('%(senderDisplayName)s changed the room name to %(roomName)s.', { + debugger; + return _t('%(senderDisplayName)s changed the room name from %(oldRoomName)s to %(newRoomName)s.', { senderDisplayName, - roomName: ev.getContent().name, + oldRoomName: ev.getPrevContent().name, + newRoomName: ev.getContent().name, }); } diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 01ba458a2f..8b4e9417bb 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -228,7 +228,7 @@ "%(senderName)s kicked %(targetName)s.": "%(senderName)s kicked %(targetName)s.", "%(senderDisplayName)s changed the topic to \"%(topic)s\".": "%(senderDisplayName)s changed the topic to \"%(topic)s\".", "%(senderDisplayName)s removed the room name.": "%(senderDisplayName)s removed the room name.", - "%(senderDisplayName)s changed the room name to %(roomName)s.": "%(senderDisplayName)s changed the room name to %(roomName)s.", + "%(senderDisplayName)s changed the room name from %(oldRoomName)s to %(newRoomName)s.": "%(senderDisplayName)s changed the room name from %(oldRoomName)s to %(newRoomName)s.", "%(senderDisplayName)s upgraded this room.": "%(senderDisplayName)s upgraded this room.", "%(senderDisplayName)s made the room public to whoever knows the link.": "%(senderDisplayName)s made the room public to whoever knows the link.", "%(senderDisplayName)s made the room invite only.": "%(senderDisplayName)s made the room invite only.",