share user pill postfix between autocomplete and insert mention

where we decide to add a colon only if the composer is empty
This commit is contained in:
Bruno Windels 2019-09-02 14:06:30 +02:00
parent c219f925c6
commit c595371845
3 changed files with 10 additions and 5 deletions

View file

@ -441,6 +441,12 @@ export class PartCreator {
const member = this._room.getMember(userId);
return new UserPillPart(userId, displayName, member);
}
createMentionParts(partIndex, displayName, userId) {
const pill = this.userPill(displayName, userId);
const postfix = this.plain(partIndex === 0 ? ": " : " ");
return [pill, postfix];
}
}
// part creator that support auto complete for /commands,