From b9e5e5494d504ec19d6ddf22b9e58db83cf0c3d6 Mon Sep 17 00:00:00 2001 From: Sam Wedgwood Date: Thu, 6 Jul 2023 12:06:36 +0100 Subject: [PATCH] Rename some occurences of MSC2946 - still need to rename some identifiers from GMSL --- clientapi/routing/room_hierarchy.go | 4 ++-- federationapi/api/api.go | 2 +- federationapi/internal/federationclient.go | 2 +- roomserver/internal/query/query_room_hierarchy.go | 2 +- setup/mscs/msc2946/msc2946.go | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/clientapi/routing/room_hierarchy.go b/clientapi/routing/room_hierarchy.go index 22b29f487..639f7b35d 100644 --- a/clientapi/routing/room_hierarchy.go +++ b/clientapi/routing/room_hierarchy.go @@ -136,7 +136,7 @@ func QueryRoomHierarchy(req *http.Request, device *userapi.Device, roomIDStr str return util.JSONResponse{ Code: http.StatusOK, - JSON: MSC2946ClientResponse{ + JSON: RoomHierarchyClientResponse{ Rooms: discoveredRooms, NextBatch: nextBatch, }, @@ -144,7 +144,7 @@ func QueryRoomHierarchy(req *http.Request, device *userapi.Device, roomIDStr str } -type MSC2946ClientResponse struct { +type RoomHierarchyClientResponse struct { Rooms []fclient.MSC2946Room `json:"rooms"` NextBatch string `json:"next_batch,omitempty"` } diff --git a/federationapi/api/api.go b/federationapi/api/api.go index 6d8ae0a12..38cd39375 100644 --- a/federationapi/api/api.go +++ b/federationapi/api/api.go @@ -75,7 +75,7 @@ type RoomserverFederationAPI interface { GetEvent(ctx context.Context, origin, s spec.ServerName, eventID string) (res gomatrixserverlib.Transaction, err error) LookupMissingEvents(ctx context.Context, origin, s spec.ServerName, roomID string, missing fclient.MissingEvents, roomVersion gomatrixserverlib.RoomVersion) (res fclient.RespMissingEvents, err error) - MSC2946Spaces(ctx context.Context, origin, dst spec.ServerName, roomID string, suggestedOnly bool) (res fclient.MSC2946SpacesResponse, err error) + RoomHierarchies(ctx context.Context, origin, dst spec.ServerName, roomID string, suggestedOnly bool) (res fclient.MSC2946SpacesResponse, err error) } type P2PFederationAPI interface { diff --git a/federationapi/internal/federationclient.go b/federationapi/internal/federationclient.go index d4d7269db..d5a45248d 100644 --- a/federationapi/internal/federationclient.go +++ b/federationapi/internal/federationclient.go @@ -194,7 +194,7 @@ func (a *FederationInternalAPI) MSC2836EventRelationships( return ires.(fclient.MSC2836EventRelationshipsResponse), nil } -func (a *FederationInternalAPI) MSC2946Spaces( +func (a *FederationInternalAPI) RoomHierarchies( ctx context.Context, origin, s spec.ServerName, roomID string, suggestedOnly bool, ) (res fclient.MSC2946SpacesResponse, err error) { ctx, cancel := context.WithTimeout(ctx, time.Minute) diff --git a/roomserver/internal/query/query_room_hierarchy.go b/roomserver/internal/query/query_room_hierarchy.go index e4ac75e03..a1d9ae2c4 100644 --- a/roomserver/internal/query/query_room_hierarchy.go +++ b/roomserver/internal/query/query_room_hierarchy.go @@ -260,7 +260,7 @@ func (w *RoomHierarchyWalker) federatedRoomInfo(roomID string, vias []string) *f if serverName == string(w.thisServer) { continue } - res, err := w.fsAPI.MSC2946Spaces(ctx, w.thisServer, spec.ServerName(serverName), roomID, w.suggestedOnly) + res, err := w.fsAPI.RoomHierarchies(ctx, w.thisServer, spec.ServerName(serverName), roomID, w.suggestedOnly) if err != nil { util.GetLogger(w.ctx).WithError(err).Warnf("failed to call MSC2946Spaces on server %s", serverName) continue diff --git a/setup/mscs/msc2946/msc2946.go b/setup/mscs/msc2946/msc2946.go index 64b95ffd1..3a0c181dc 100644 --- a/setup/mscs/msc2946/msc2946.go +++ b/setup/mscs/msc2946/msc2946.go @@ -435,7 +435,7 @@ func (w *walker) federatedRoomInfo(roomID string, vias []string) *fclient.MSC294 if serverName == string(w.thisServer) { continue } - res, err := w.fsAPI.MSC2946Spaces(ctx, w.thisServer, spec.ServerName(serverName), roomID, w.suggestedOnly) + res, err := w.fsAPI.RoomHierarchies(ctx, w.thisServer, spec.ServerName(serverName), roomID, w.suggestedOnly) if err != nil { util.GetLogger(w.ctx).WithError(err).Warnf("failed to call MSC2946Spaces on server %s", serverName) continue