Fix matrix api joinRoom() for remote rooms (#60)

When using self-service mode and trying to link with a remote matrix
room (room not in the same HS as the bridge user), then we need to add
the "via" HSs to join the room with, or else it fails.

We get it from the "m.space.child" in the "children_state" of the space
hierarchy.

Co-authored-by: Cadence Ember <cadence@disroot.org>
Reviewed-on: https://gitdab.com/cadence/out-of-your-element/pulls/60
Co-authored-by: Elliu <elliu@hashi.re>
Co-committed-by: Elliu <elliu@hashi.re>
This commit is contained in:
Elliu
2025-11-02 07:50:16 +00:00
committed by cadence
parent 255e166e8c
commit d95a114377
8 changed files with 115 additions and 18 deletions

10
src/types.d.ts vendored
View File

@@ -149,6 +149,14 @@ export namespace Event {
prev_content?: any
}
export type StrippedChildStateEvent = {
type: string
state_key: string
sender: string
origin_server_ts: number
content: any
}
export type M_Room_Message = {
msgtype: "m.text" | "m.emote"
body: string
@@ -345,7 +353,7 @@ export namespace R {
export type Hierarchy = {
avatar_url?: string
canonical_alias?: string
children_state: {}
children_state: Event.StrippedChildStateEvent[]
guest_can_join: boolean
join_rule?: string
name?: string