Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2193 from Half-Shot/hs/purge-irc-hack
Browse files Browse the repository at this point in the history
Drop (IRC) suffix hacks
  • Loading branch information
dbkr authored Oct 4, 2018
2 parents 1189b75 + 8ceca3a commit 21cedba
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/autocomplete/UserProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,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 || '');
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,
completionId: user.userId,
suffix: (selection.beginning && range.start === 0) ? ': ' : ' ',
href: makeUserPermalink(user.userId),
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/elements/Pill.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,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 = <MemberAvatar member={member} width={16} height={16} />;
}
Expand Down
3 changes: 0 additions & 3 deletions src/components/views/messages/SenderProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,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 = <Flair key='flair'
userId={mxEvent.getSender()}
groups={displayedGroups}
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/rooms/MessageComposerInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ export default class MessageComposerInput extends React.Component {
const selection = this.getSelectionRange(this.state.editorState);
const member = this.props.room.getMember(payload.user_id);
const completion = member ?
member.rawDisplayName.replace(' (IRC)', '') : payload.user_id;
member.rawDisplayName : payload.user_id;
this.setDisplayedCompletion({
completion,
completionId: payload.user_id,
Expand Down

0 comments on commit 21cedba

Please sign in to comment.