matiaslina / Matrix-Client

Matrix client for Raku
Artistic License 2.0
13 stars 3 forks source link

Can I .join-room using a local address? #8

Open AlexDaniel opened 6 years ago

AlexDaniel commented 6 years ago

Rooms may have an address in a form of e.g. #freenode_#whateverable:matrix.org. However, an address like this is not accepted in $client.join-room: …, and I have to use internal room id like !AZDMTOPHOfnSNBeubl:matrix.org. Why so? And is there any way to use the readable address?

AlexDaniel commented 6 years ago

Ah-ha, I see. Basically you'd need to first get the room id by alias, and then use that id to join the room. Maybe .join-room should have a convenience multi that does that.

matiaslina commented 6 years ago

The original endpoint needs a roomId (those are the !AZDMTOPHOfnSNBeubl:matrix.org). There's another endpoint to join a room which takes a roomIdOrAlias so #freenode_#whateverable:matrix.org or !AZDMTOPHOfnSNBeubl:matrix.org will work.

Btw, today I've changed join-room to use the second endpoint. I don't know if there's any downside.