From fe788486b77762e065320bcbce548873811fe596 Mon Sep 17 00:00:00 2001 From: Will Hunt Date: Wed, 3 Oct 2018 19:34:06 +0100 Subject: [PATCH 1/3] Drop (IRC) suffix hacks --- src/autocomplete/UserProvider.js | 4 ++-- src/components/views/elements/Pill.js | 2 +- src/components/views/messages/SenderProfile.js | 3 --- src/components/views/rooms/MessageComposerInput.js | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/autocomplete/UserProvider.js b/src/autocomplete/UserProvider.js index 85837d5ebb..bdc1753da7 100644 --- a/src/autocomplete/UserProvider.js +++ b/src/autocomplete/UserProvider.js @@ -108,11 +108,11 @@ export default class UserProvider extends AutocompleteProvider { // Don't search if the query is a single "@" if (fullMatch && fullMatch !== '@') { completions = this.matcher.match(fullMatch).map((user) => { - const displayName = (user.name || user.userId || '').replace(' (IRC)', ''); // FIXME when groups are done + const displayName = (user.name || user.userId || ''); // FIXME when groups are done return { // Length of completion should equal length of text in decorator. draft-js // relies on the length of the entity === length of the text in the decoration. - completion: user.rawDisplayName.replace(' (IRC)', ''), + completion: user.rawDisplayName, suffix: range.start === 0 ? ': ' : ' ', href: makeUserPermalink(user.userId), component: ( diff --git a/src/components/views/elements/Pill.js b/src/components/views/elements/Pill.js index e14d6c37c9..e37e45838a 100644 --- a/src/components/views/elements/Pill.js +++ b/src/components/views/elements/Pill.js @@ -229,7 +229,7 @@ const Pill = React.createClass({ if (member) { userId = member.userId; member.rawDisplayName = member.rawDisplayName || ''; - linkText = member.rawDisplayName.replace(' (IRC)', ''); // FIXME when groups are done + linkText = member.rawDisplayName, if (this.props.shouldShowPillAvatar) { avatar = ; } diff --git a/src/components/views/messages/SenderProfile.js b/src/components/views/messages/SenderProfile.js index 5ca2fc6ed8..620f66bb03 100644 --- a/src/components/views/messages/SenderProfile.js +++ b/src/components/views/messages/SenderProfile.js @@ -111,9 +111,6 @@ export default React.createClass({ this.state.userGroups, this.state.relatedGroups, ); - // Backwards-compatible replacing of "(IRC)" with AS user flair - name = displayedGroups.length > 0 ? name.replace(' (IRC)', '') : name; - flair = Date: Wed, 3 Oct 2018 19:39:47 +0100 Subject: [PATCH 2/3] The comment can go --- src/autocomplete/UserProvider.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/autocomplete/UserProvider.js b/src/autocomplete/UserProvider.js index 24dfa8be3e..e9cbf7945b 100644 --- a/src/autocomplete/UserProvider.js +++ b/src/autocomplete/UserProvider.js @@ -105,7 +105,7 @@ export default class UserProvider extends AutocompleteProvider { // Don't search if the query is a single "@" if (fullMatch && fullMatch !== '@') { completions = this.matcher.match(fullMatch).map((user) => { - const displayName = (user.name || user.userId || ''); // FIXME when groups are done + const displayName = (user.name || user.userId || ''); return { // Length of completion should equal length of text in decorator. draft-js // relies on the length of the entity === length of the text in the decoration. From 8ceca3abe943486c3dc6548c199b215d49a6f8ac Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 4 Oct 2018 10:34:34 +0100 Subject: [PATCH 3/3] Update Pill.js Commas are not semicolons --- src/components/views/elements/Pill.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/elements/Pill.js b/src/components/views/elements/Pill.js index 25b40d186d..af7e8c4ae3 100644 --- a/src/components/views/elements/Pill.js +++ b/src/components/views/elements/Pill.js @@ -234,7 +234,7 @@ const Pill = React.createClass({ if (member) { userId = member.userId; member.rawDisplayName = member.rawDisplayName || ''; - linkText = member.rawDisplayName, + linkText = member.rawDisplayName; if (this.props.shouldShowPillAvatar) { avatar = ; }