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

@ -22,7 +22,6 @@ import (
"github.com/matrix-org/dendrite/internal/sqlutil"
"github.com/matrix-org/dendrite/setup/config"
"github.com/matrix-org/gomatrixserverlib"
"github.com/tidwall/gjson"
)
var (
@ -175,7 +174,7 @@ func SpaceTarget(he *gomatrixserverlib.HeaderedEvent) string {
}
switch he.Type() {
case ConstSpaceParentEventType:
return gjson.GetBytes(he.Content(), "room_id").Str
return *he.StateKey()
case ConstSpaceChildEventType:
return *he.StateKey()
}