aboutsummaryrefslogtreecommitdiff
path: root/roomserver/internal/query
diff options
context:
space:
mode:
authordevonh <devon.dmytro@gmail.com>2023-09-15 14:39:06 +0000
committerGitHub <noreply@github.com>2023-09-15 14:39:06 +0000
commit8245b24100b0afaa046bb3fe52f0994f906c8ab1 (patch)
treef8d65fd4c27e208e5829f5ca0f66d79c639fabdb /roomserver/internal/query
parent058081e68e4e23400645c6206cedddba8a31507e (diff)
Update gmsl to use new validated RoomID on PDUs (#3200)
GMSL returns a `spec.RoomID` when calling `PDU.RoomID()`
Diffstat (limited to 'roomserver/internal/query')
-rw-r--r--roomserver/internal/query/query_room_hierarchy.go4
-rw-r--r--roomserver/internal/query/query_test.go1
2 files changed, 3 insertions, 2 deletions
diff --git a/roomserver/internal/query/query_room_hierarchy.go b/roomserver/internal/query/query_room_hierarchy.go
index 7274be52..76eba12b 100644
--- a/roomserver/internal/query/query_room_hierarchy.go
+++ b/roomserver/internal/query/query_room_hierarchy.go
@@ -513,14 +513,14 @@ func restrictedJoinRuleAllowedRooms(ctx context.Context, joinRuleEv *types.Heade
}
var jrContent gomatrixserverlib.JoinRuleContent
if err := json.Unmarshal(joinRuleEv.Content(), &jrContent); err != nil {
- util.GetLogger(ctx).Warnf("failed to check join_rule on room %s: %s", joinRuleEv.RoomID(), err)
+ util.GetLogger(ctx).Warnf("failed to check join_rule on room %s: %s", joinRuleEv.RoomID().String(), err)
return nil
}
for _, allow := range jrContent.Allow {
if allow.Type == spec.MRoomMembership {
allowedRoomID, err := spec.NewRoomID(allow.RoomID)
if err != nil {
- util.GetLogger(ctx).Warnf("invalid room ID '%s' found in join_rule on room %s: %s", allow.RoomID, joinRuleEv.RoomID(), err)
+ util.GetLogger(ctx).Warnf("invalid room ID '%s' found in join_rule on room %s: %s", allow.RoomID, joinRuleEv.RoomID().String(), err)
} else {
allows = append(allows, *allowedRoomID)
}
diff --git a/roomserver/internal/query/query_test.go b/roomserver/internal/query/query_test.go
index 619d9303..296960b2 100644
--- a/roomserver/internal/query/query_test.go
+++ b/roomserver/internal/query/query_test.go
@@ -49,6 +49,7 @@ func (db *getEventDB) addFakeEvent(eventID string, authIDs []string) error {
}
builder := map[string]interface{}{
"event_id": eventID,
+ "room_id": "!room:a",
"auth_events": authEvents,
}