dendrite icon indicating copy to clipboard operation
dendrite copied to clipboard

[minor] Incorrect invitee displayname when inviting at room creation

Open anton-molyboha opened this issue 2 years ago • 2 comments

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".

anton-molyboha avatar Mar 27 '24 20:03 anton-molyboha

This should already be fixed by #3326 on main.

S7evinK avatar Mar 27 '24 21:03 S7evinK

Oh, my bad. Thank you!

anton-molyboha avatar Mar 28 '24 00:03 anton-molyboha