Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove remaining mentions of MSC2946 #403

Merged
merged 1 commit into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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