Drop (IRC) suffix hacks

This commit is contained in:
Will Hunt 2018-10-03 19:34:06 +01:00
parent 5b027c6410
commit fe788486b7
4 changed files with 4 additions and 7 deletions

View file

@ -108,11 +108,11 @@ export default class UserProvider extends AutocompleteProvider {
// Don't search if the query is a single "@" // Don't search if the query is a single "@"
if (fullMatch && fullMatch !== '@') { if (fullMatch && fullMatch !== '@') {
completions = this.matcher.match(fullMatch).map((user) => { 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 { return {
// Length of completion should equal length of text in decorator. draft-js // 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. // 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 ? ': ' : ' ', suffix: range.start === 0 ? ': ' : ' ',
href: makeUserPermalink(user.userId), href: makeUserPermalink(user.userId),
component: ( component: (

View file

@ -229,7 +229,7 @@ const Pill = React.createClass({
if (member) { if (member) {
userId = member.userId; userId = member.userId;
member.rawDisplayName = member.rawDisplayName || ''; member.rawDisplayName = member.rawDisplayName || '';
linkText = member.rawDisplayName.replace(' (IRC)', ''); // FIXME when groups are done linkText = member.rawDisplayName,
if (this.props.shouldShowPillAvatar) { if (this.props.shouldShowPillAvatar) {
avatar = <MemberAvatar member={member} width={16} height={16} />; avatar = <MemberAvatar member={member} width={16} height={16} />;
} }

View file

@ -111,9 +111,6 @@ export default React.createClass({
this.state.userGroups, this.state.relatedGroups, 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' flair = <Flair key='flair'
userId={mxEvent.getSender()} userId={mxEvent.getSender()}
groups={displayedGroups} groups={displayedGroups}

View file

@ -284,7 +284,7 @@ export default class MessageComposerInput extends React.Component {
const selection = this.state.editorState.getSelection(); const selection = this.state.editorState.getSelection();
const member = this.props.room.getMember(payload.user_id); const member = this.props.room.getMember(payload.user_id);
const completion = member ? const completion = member ?
member.rawDisplayName.replace(' (IRC)', '') : payload.user_id; member.rawDisplayName : payload.user_id;
this.setDisplayedCompletion({ this.setDisplayedCompletion({
completion, completion,
selection, selection,