dendrite
dendrite copied to clipboard
[minor] Incorrect invitee displayname when inviting at room creation
Background information
- Dendrite version or git SHA: 0.13.6
- SQLite3 or Postgres?: Postgres
- Running in Docker?: no
go version: 1.21.5- Client used (if applicable): curl, Element Desktop
Description
The room creation endpoint /_matrix/client/v3/createRoom accepts an optional list of accounts to invite to the newly created room. When I invite somebody via this endpoint, their displayname shows as that of the inviter rather than invitee.
(sorry for poor wording, see "steps to reproduce" below, they are much more clear)
Steps to reproduce
- run
curl --data '{"name": "Test room", "invite": ["@anton:rendezvous.anton.molyboha.me"]}' --header 'Authorization: Bearer <redacted>' https://rendezvous.anton.molyboha.me/_matrix/client/v3/createRoom
- accept the invitation in Element Desktop (or another client)
- look at the source of the invitation message. What I see is:
{
"content": {
"displayname": "test1",
"membership": "invite"
},
"event_id": "<redacted>",
"origin_server_ts": 1711569816249,
"sender": "@test1:rendezvous.anton.molyboha.me",
"state_key": "@anton:rendezvous.anton.molyboha.me",
"type": "m.room.member",
"unsigned": {
"invite_room_state": [
{
"content": {
"creator": "@test1:rendezvous.anton.molyboha.me",
"room_version": "10"
},
"sender": "@test1:rendezvous.anton.molyboha.me",
"state_key": "",
"type": "m.room.create"
},
{
"content": {
"displayname": "test1",
"membership": "join"
},
"sender": "@test1:rendezvous.anton.molyboha.me",
"state_key": "@test1:rendezvous.anton.molyboha.me",
"type": "m.room.member"
},
{
"content": {
"join_rule": "invite"
},
"sender": "@test1:rendezvous.anton.molyboha.me",
"state_key": "",
"type": "m.room.join_rules"
},
{
"content": {
"name": "Test room"
},
"sender": "@test1:rendezvous.anton.molyboha.me",
"state_key": "",
"type": "m.room.name"
}
]
},
"room_id": "<redacted>:rendezvous.anton.molyboha.me"
}
Notice "displayname": "test1" part. The actual displayname for @anton:rendezvous.anton.molyboha.me is unset, so I expected "displayname" field to either be absent or to say "anton".
This should already be fixed by #3326 on main.
Oh, my bad. Thank you!