What is the difference between a room id of !example391:server.com and #example:server.com for a user at server2.com? Is there also a way to assign an internal address starting with a #? Everytime I try to make it internal only, it becomes external at the same time. I also noticed that Element allows me to assign custom room addresses from different servers, how would that be possible?

  • Ananace
    link
    fedilink
    6
    edit-2
    6 months ago

    The # is a room alias, only ! denotes a room ID.

    Room IDs are the main identifier for a room, while one or more aliases can also be assigned to it for discovery purposes.
    Any server can assign aliases - and therefore also serve the room discovery, but only if the room admins allow them.

    Using the Matrix HQ room as an example; #matrix:matrix.org is the canonical alias for the room, mapping to !OGEhHVWSdvArJzumhm:matrix.org.
    If you want to join the room, you either need to know the ID and some information on which servers are currently part of the room, or you need to know a room alias - which can be used to query the server owning it in order to receive the information on the room and how to join it.

    For example; (%23 is the HTTP entity for #, since # would otherwise be handled as a client part of the URL)

    $ curl -q 'https://matrix.org/_matrix/client/v3/directory/room/%23matrix:matrix.org' | jq '.room_id, .servers[0,1]'
    "!OGEhHVWSdvArJzumhm:matrix.org"
    "matrix.org"
    "artemislena.eu"