Skip to content

Commit

Permalink
Remove remaining mentions of MSC2946 (#403)
Browse files Browse the repository at this point in the history
Remove mentions of MSC2946, as it it part of the spec. (For
matrix-org/dendrite#3134 ).

Signed-off-by: `Sam Wedgwood <[email protected]>`
  • Loading branch information
swedgwood authored Jul 20, 2023
1 parent cf82e01 commit c87b4ea
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions fclient/federationclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type FederationClient interface {
QueryKeys(ctx context.Context, origin, s spec.ServerName, keys map[string][]string) (RespQueryKeys, error)
Backfill(ctx context.Context, origin, s spec.ServerName, roomID string, limit int, eventIDs []string) (res gomatrixserverlib.Transaction, err error)
MSC2836EventRelationships(ctx context.Context, origin, dst spec.ServerName, r MSC2836EventRelationshipsRequest, roomVersion gomatrixserverlib.RoomVersion) (res MSC2836EventRelationshipsResponse, err error)
MSC2946Spaces(ctx context.Context, origin, dst spec.ServerName, roomID string, suggestedOnly bool) (res MSC2946SpacesResponse, err error)
RoomHierarchy(ctx context.Context, origin, dst spec.ServerName, roomID string, suggestedOnly bool) (res RoomHierarchyResponse, err error)

ExchangeThirdPartyInvite(ctx context.Context, origin, s spec.ServerName, builder gomatrixserverlib.ProtoEvent) (err error)
LookupState(ctx context.Context, origin, s spec.ServerName, roomID string, eventID string, roomVersion gomatrixserverlib.RoomVersion) (res RespState, err error)
Expand Down Expand Up @@ -710,9 +710,9 @@ func (ac *federationClient) MSC2836EventRelationships(
return
}

func (ac *federationClient) MSC2946Spaces(
func (ac *federationClient) RoomHierarchy(
ctx context.Context, origin, dst spec.ServerName, roomID string, suggestedOnly bool,
) (res MSC2946SpacesResponse, err error) {
) (res RoomHierarchyResponse, err error) {
path := "/_matrix/federation/v1/hierarchy/" + url.PathEscape(roomID)
if suggestedOnly {
path += "?suggested_only=true"
Expand Down
24 changes: 12 additions & 12 deletions fclient/federationtypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,24 +528,24 @@ type MSC2836EventRelationshipsResponse struct {
AuthChain gomatrixserverlib.EventJSONs `json:"auth_chain"`
}

// MSC2946Room represents a public room with additional metadata on the space directory
type MSC2946Room struct {
// RoomHierarchyRoom represents a public room with additional metadata on the space directory
type RoomHierarchyRoom struct {
PublicRoom
ChildrenState []MSC2946StrippedEvent `json:"children_state"`
AllowedRoomIDs []string `json:"allowed_room_ids,omitempty"`
RoomType string `json:"room_type"`
ChildrenState []RoomHierarchyStrippedEvent `json:"children_state"`
AllowedRoomIDs []string `json:"allowed_room_ids,omitempty"`
RoomType string `json:"room_type"`
}

// MSC2946SpacesResponse is the HTTP response body for the federation /unstable/spaces/{roomID} endpoint
// RoomHierarchyResponse is the HTTP response body for the federation /unstable/spaces/{roomID} endpoint
// See https://github.com/matrix-org/matrix-doc/pull/2946
type MSC2946SpacesResponse struct {
Room MSC2946Room `json:"room"`
Children []MSC2946Room `json:"children"`
InaccessibleChildren []string `json:"inaccessible_children"`
type RoomHierarchyResponse struct {
Room RoomHierarchyRoom `json:"room"`
Children []RoomHierarchyRoom `json:"children"`
InaccessibleChildren []string `json:"inaccessible_children"`
}

// MSC2946StrippedEvent is the format of events returned in the HTTP response body
type MSC2946StrippedEvent struct {
// RoomHierarchyStrippedEvent is the format of events returned in the HTTP response body
type RoomHierarchyStrippedEvent struct {
Type string `json:"type"`
StateKey string `json:"state_key"`
Content json.RawMessage `json:"content"`
Expand Down

0 comments on commit c87b4ea

Please sign in to comment.