MSC2946: Use new MSC1772 format for space parents (#1713)

This commit is contained in:
Kegsay 2021-01-15 12:30:41 +00:00 committed by GitHub
parent 2626525c65
commit 5366c33885
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 23 deletions

View file

@ -86,8 +86,7 @@ func TestMSC2946(t *testing.T) {
Type: msc2946.ConstSpaceChildEventType,
StateKey: &room1,
Content: map[string]interface{}{
"via": []string{"localhost"},
"present": true,
"via": []string{"localhost"},
},
})
rootToR2 := mustCreateEvent(t, fledglingEvent{
@ -96,8 +95,7 @@ func TestMSC2946(t *testing.T) {
Type: msc2946.ConstSpaceChildEventType,
StateKey: &room2,
Content: map[string]interface{}{
"via": []string{"localhost"},
"present": true,
"via": []string{"localhost"},
},
})
rootToS1 := mustCreateEvent(t, fledglingEvent{
@ -106,8 +104,7 @@ func TestMSC2946(t *testing.T) {
Type: msc2946.ConstSpaceChildEventType,
StateKey: &subSpaceS1,
Content: map[string]interface{}{
"via": []string{"localhost"},
"present": true,
"via": []string{"localhost"},
},
})
s1ToR3 := mustCreateEvent(t, fledglingEvent{
@ -116,8 +113,7 @@ func TestMSC2946(t *testing.T) {
Type: msc2946.ConstSpaceChildEventType,
StateKey: &room3,
Content: map[string]interface{}{
"via": []string{"localhost"},
"present": true,
"via": []string{"localhost"},
},
})
s1ToR4 := mustCreateEvent(t, fledglingEvent{
@ -126,8 +122,7 @@ func TestMSC2946(t *testing.T) {
Type: msc2946.ConstSpaceChildEventType,
StateKey: &room4,
Content: map[string]interface{}{
"via": []string{"localhost"},
"present": true,
"via": []string{"localhost"},
},
})
s1ToS2 := mustCreateEvent(t, fledglingEvent{
@ -136,8 +131,7 @@ func TestMSC2946(t *testing.T) {
Type: msc2946.ConstSpaceChildEventType,
StateKey: &subSpaceS2,
Content: map[string]interface{}{
"via": []string{"localhost"},
"present": true,
"via": []string{"localhost"},
},
})
// This is a parent link only
@ -145,11 +139,9 @@ func TestMSC2946(t *testing.T) {
RoomID: room5,
Sender: alice,
Type: msc2946.ConstSpaceParentEventType,
StateKey: &empty,
StateKey: &subSpaceS2,
Content: map[string]interface{}{
"room_id": subSpaceS2,
"via": []string{"localhost"},
"present": true,
"via": []string{"localhost"},
},
})
// history visibility for R4