Allow services to emulate/impersonate user (send with username)
It would be great if the API allowed bots to specify a username with each request. This would make it possible to write a bridge to a Matrix or IRC channel, for instance, with matching usernames.
Related: #662
Previous implementation plan
Iteration 1
- Add
botInternalUserId
field to the chat message schema- Allow this to be passed in from the API
- Update the
duplicate-chat-detector.js
to sum onbotInternalUserId
if available - Update the chat report service to sum on
botInternalUserId
if available
Iteration 2
- Add in rich avatar and display name
Implementation
Add a message.virtualUser
field to the chat message schema.
"virtualUser": {
"type": "matrix",
"externalId": "madlittlemods:matrix.org",
"displayName": "madlittlemods (Eric Eastwood)",
"avatarUrl": "https://matrix-client.matrix.org/_matrix/media/r0/thumbnail/matrix.org/bDayqThxTIcGNcskzIADknRv?width=30&height=30&method=crop"
},
- We may need to stub
message.fromUser
to support the legacy clients like the Android/iOS easier. - Support room bans for virtual users
- Support chat spam bans for virtual users
Edited by Eric Eastwood