Skip to content

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.

What does a mention look like for a Matrix virtualUser?

Option 1 - Just use MXID's

$ 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