From 1ac82a9f165c145c12ea796eb29968a97e37a510 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 23 Jan 2020 14:59:52 -0700 Subject: [PATCH] Revert "Don't list every single alias when there's many" This reverts commit 6fc647c3d969aff9bba47e209e2b48bbebfc91a6. --- src/TextForEvent.js | 24 ------------------------ src/i18n/strings/en_EN.json | 3 --- 2 files changed, 27 deletions(-) diff --git a/src/TextForEvent.js b/src/TextForEvent.js index 6a2744109b..a0d088affb 100644 --- a/src/TextForEvent.js +++ b/src/TextForEvent.js @@ -275,8 +275,6 @@ function textForRoomAliasesEvent(ev) { // This feels a bit overkill though, and it's not clear the i18n really needs it // so instead it's landing as a simple textual event. - const maxShown = 3; - const senderName = ev.sender && ev.sender.name ? ev.sender.name : ev.getSender(); const oldAliases = ev.getPrevContent().aliases || []; const newAliases = ev.getContent().aliases || []; @@ -289,40 +287,18 @@ function textForRoomAliasesEvent(ev) { } if (addedAliases.length && !removedAliases.length) { - if (addedAliases.length > maxShown) { - return _t("%(senderName)s added %(addedAddresses)s and %(count)s other addresses to this room", { - senderName: senderName, - count: addedAliases.length - maxShown, - addedAddresses: addedAliases.slice(0, maxShown).join(', '), - }); - } return _t('%(senderName)s added %(count)s %(addedAddresses)s as addresses for this room.', { senderName: senderName, count: addedAliases.length, addedAddresses: addedAliases.join(', '), }); } else if (!addedAliases.length && removedAliases.length) { - if (removedAliases.length > maxShown) { - return _t("%(senderName)s removed %(removedAddresses)s and %(count)s other addresses from this room", { - senderName: senderName, - count: removedAliases.length - maxShown, - removedAddresses: removedAliases.slice(0, maxShown).join(', '), - }); - } return _t('%(senderName)s removed %(count)s %(removedAddresses)s as addresses for this room.', { senderName: senderName, count: removedAliases.length, removedAddresses: removedAliases.join(', '), }); } else { - const combined = addedAliases.length + removedAliases.length; - if (combined > maxShown) { - return _t("%(senderName)s removed %(countRemoved)s and added %(countAdded)s addresses to this room", { - senderName: senderName, - countAdded: addedAliases.length, - countRemoved: removedAliases.length, - }); - } return _t( '%(senderName)s added %(addedAddresses)s and removed %(removedAddresses)s as addresses for this room.', { senderName: senderName, diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index c86640132a..9060279e54 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -235,13 +235,10 @@ "%(senderDisplayName)s disabled flair for %(groups)s in this room.": "%(senderDisplayName)s disabled flair for %(groups)s in this room.", "%(senderDisplayName)s enabled flair for %(newGroups)s and disabled flair for %(oldGroups)s in this room.": "%(senderDisplayName)s enabled flair for %(newGroups)s and disabled flair for %(oldGroups)s in this room.", "%(senderDisplayName)s sent an image.": "%(senderDisplayName)s sent an image.", - "%(senderName)s added %(addedAddresses)s and %(count)s other addresses to this room|other": "%(senderName)s added %(addedAddresses)s and %(count)s other addresses to this room", "%(senderName)s added %(count)s %(addedAddresses)s as addresses for this room.|other": "%(senderName)s added %(addedAddresses)s as addresses for this room.", "%(senderName)s added %(count)s %(addedAddresses)s as addresses for this room.|one": "%(senderName)s added %(addedAddresses)s as an address for this room.", - "%(senderName)s removed %(removedAddresses)s and %(count)s other addresses from this room|other": "%(senderName)s removed %(removedAddresses)s and %(count)s other addresses from this room", "%(senderName)s removed %(count)s %(removedAddresses)s as addresses for this room.|other": "%(senderName)s removed %(removedAddresses)s as addresses for this room.", "%(senderName)s removed %(count)s %(removedAddresses)s as addresses for this room.|one": "%(senderName)s removed %(removedAddresses)s as an address for this room.", - "%(senderName)s removed %(countRemoved)s and added %(countAdded)s addresses to this room": "%(senderName)s removed %(countRemoved)s and added %(countAdded)s addresses to this room", "%(senderName)s added %(addedAddresses)s and removed %(removedAddresses)s as addresses for this room.": "%(senderName)s added %(addedAddresses)s and removed %(removedAddresses)s as addresses for this room.", "%(senderName)s set the main address for this room to %(address)s.": "%(senderName)s set the main address for this room to %(address)s.", "%(senderName)s removed the main address for this room.": "%(senderName)s removed the main address for this room.",