Add virtualUsers to the typeahead
Follow-up to https://gitlab.com/gitlab-org/gitter/webapp/-/issues/1076
Add virtualUsers
to the typeahead. We need a way for people to easily mention the virtual users chatting in the room.
We will initially only support mentioning users who are in the visible messages for the room (most recent chatters). In the future, we can probably hit/query a Matrix endpoint to be able to reference anyone else.
virtualUser
?
What does a mention look like for a Matrix @Half-Shot:half-shot.uk
@madlittlemods:matrix.org
- Maybe we can assume anything with a colon is Matrix
- We can check Mongo for any existing conflicts with this assumption (reference https://gitlab.com/gitlab-org/gitter/webapp/-/issues/2471#note_329771574)
$ ssh mongo-replica-02.prod.gitter
$ mongo gitter
> rs.slaveOk()
> db.users.find({ username: { $regex: /.*:.*/ } });
# gives no results :tada:
Option 2:
@matrix:Half-Shot:half-shot.uk
@matrix:madlittlemods:matrix.org
Option 3:
@matrix->Half-Shot:half-shot.uk
@matrix->madlittlemods:matrix.org
Relevant code
Add to typeahead list:
Edited by Eric Eastwood