DRY matrix.to link generation so it is all changeable in one class
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
4666ac7c83
commit
5c229b9ef8
5 changed files with 11 additions and 9 deletions
|
@ -28,6 +28,7 @@ import _sortBy from 'lodash/sortBy';
|
|||
import MatrixClientPeg from '../MatrixClientPeg';
|
||||
|
||||
import type {Room, RoomMember} from 'matrix-js-sdk';
|
||||
import {makeUserPermalink} from "../matrix-to";
|
||||
|
||||
const USER_REGEX = /@\S*/g;
|
||||
|
||||
|
@ -104,7 +105,7 @@ export default class UserProvider extends AutocompleteProvider {
|
|||
// relies on the length of the entity === length of the text in the decoration.
|
||||
completion: user.rawDisplayName.replace(' (IRC)', ''),
|
||||
suffix: range.start === 0 ? ': ' : ' ',
|
||||
href: 'https://matrix.to/#/' + user.userId,
|
||||
href: makeUserPermalink(user.userId),
|
||||
component: (
|
||||
<PillCompletion
|
||||
initialComponent={<MemberAvatar member={user} width={24} height={24} />}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue