mirror of https://github.com/vector-im/riot-web
Merge pull request #1285 from matrix-org/luke/fix-rte-mention-ambiguation
For mentions, always use rawDisplayName and remove (IRC)pull/21833/head
commit
f496d2de8b
|
@ -62,7 +62,7 @@ export default class UserProvider extends AutocompleteProvider {
|
||||||
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,
|
completion: user.rawDisplayName.replace(' (IRC)', ''),
|
||||||
suffix: range.start === 0 ? ': ' : ' ',
|
suffix: range.start === 0 ? ': ' : ' ',
|
||||||
href: 'https://matrix.to/#/' + user.userId,
|
href: 'https://matrix.to/#/' + user.userId,
|
||||||
component: (
|
component: (
|
||||||
|
|
|
@ -269,7 +269,8 @@ export default class MessageComposerInput extends React.Component {
|
||||||
// paths for inserting a user pill is not fun
|
// paths for inserting a user pill is not fun
|
||||||
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 ? member.name.replace(' (IRC)', '') : payload.user_id;
|
const completion = member ?
|
||||||
|
member.rawDisplayName.replace(' (IRC)', '') : payload.user_id;
|
||||||
this.setDisplayedCompletion({
|
this.setDisplayedCompletion({
|
||||||
completion,
|
completion,
|
||||||
selection,
|
selection,
|
||||||
|
|
Loading…
Reference in New Issue