Add room ban support to virtualUsers
Add room ban support to virtualUsers
- Fix https://gitlab.com/gitlab-org/gitter/webapp/-/issues/2615
- Fix https://gitlab.com/gitlab-org/gitter/webapp/-/issues/2627
MR where we originally introduced virtualUsers
: https://gitlab.com/gitlab-org/gitter/webapp/-/merge_requests/2027
Dev notes
We can assume that any username with a :
is a Matrix username
$ ssh mongo-replica-02.prod.gitter
$ mongo gitter
> rs.slaveOk()
> db.users.find({ username: { $regex: /.*:.*/ } });
# gives no results
Todo
-
Add bans -
Remove bans -
findBanByUsername
-
scripts/utils/ban-user-from-room.js
-
How to deal with policy (related to https://gitlab.com/gitlab-org/gitter/webapp/-/issues/2041) -
Stop new messages and edits from going through -
Tests -
Fix integration activity so it handles the virtualUser ban events -> https://gitlab.com/gitlab-org/gitter/gitter-marked/-/merge_requests/12
-
We're going to move to straight MXID's instead of @matrix->asdf.matrix.org
, https://gitlab.com/gitlab-org/gitter/webapp/-/issues/2617#what-does-a-mention-look-like-for-a-matrix-virtualuser -
Revert https://gitlab.com/gitlab-org/gitter/gitter-marked/-/merge_requests/12 -
Update this MR with this change
Testing strategy
- Use the ban slash command in the chat input for a virtualUser:
/ban @ewafewafewaf:bad.org
- Use the unban slash command in the chat input for a virtualUser:
/unban @ewafewafewaf:bad.org
Edited by Eric Eastwood