/hierarchy - return public and knockable rooms for authed users

When requesting the room hierarchy with an authenticated user, return public and knockable rooms.

According to the spec, https://github.com/matrix-org/matrix-spec-proposals/blob/main/proposals/2946-spaces-summary.md

```
Any child room that the user is joined or is potentially joinable is included in the response.
```

This is currently not the case. See discussion here: https://matrix.to/#/!NasysSDfxKxZBzJJoE:matrix.org/$t2Csj-6y1PVsn8GOnFZfXzeQW13NfqvrFCxB-XI_uhA?via=matrix.org&via=libera.chat&via=element.io and here: https://matrix.to/#/!NasysSDfxKxZBzJJoE:matrix.org/$EHp1x1DY7tnYZtx_PVEb-sKB9lmJajqHx2uGlhrRh6k?via=matrix.org&via=libera.chat&via=element.io

Test Plan:
create and register clients bob and alice
have bob create a public space
have bob create a public room parented to the space
have alice join the space(room)
have alice sync the space
expect alice to see two rooms in the space hierarchy, the space and the child room
This commit is contained in:
texuf 2022-07-16 17:41:58 -07:00 committed by Tak Wai Wong
parent 5ac83189d9
commit e69af9405a
No known key found for this signature in database
GPG key ID: 222E4AF2AA1F467D
2 changed files with 3 additions and 8 deletions

View file

@ -132,11 +132,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
<<<<<<< HEAD
go: ["1.18", "1.19"] go: ["1.18", "1.19"]
=======
go: ["1.18"]
>>>>>>> 698369f5 (merge latest changes from dendrite main (#15))
goos: ["linux"] goos: ["linux"]
goarch: ["amd64", "386"] goarch: ["amd64", "386"]
steps: steps:
@ -170,11 +166,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
<<<<<<< HEAD
go: ["1.18", "1.19"] go: ["1.18", "1.19"]
=======
go: ["1.18"]
>>>>>>> 698369f5 (merge latest changes from dendrite main (#15))
goos: ["windows"] goos: ["windows"]
goarch: ["amd64"] goarch: ["amd64"]
steps: steps:

View file

@ -45,6 +45,9 @@ const (
ConstCreateEventContentValueSpace = "m.space" ConstCreateEventContentValueSpace = "m.space"
ConstSpaceChildEventType = "m.space.child" ConstSpaceChildEventType = "m.space.child"
ConstSpaceParentEventType = "m.space.parent" ConstSpaceParentEventType = "m.space.parent"
ConstJoinRulePublic = "public"
ConstJoinRuleKnock = "knock"
ConstJoinRuleRestricted = "restricted"
) )
type MSC2946ClientResponse struct { type MSC2946ClientResponse struct {