This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Support federation in the new spaces summary API (MSC2946) #10569
Merged
+518
−165
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d00ee67
Initial federation endpoint.
clokep 43088a2
Call out to federation for unknown rooms.
clokep 3c09904
Share code used for both local and remote cases.
clokep 9ccef14
Newsfragment
clokep ef4329f
Additional error checking.
clokep b4212ef
Merge remote-tracking branch 'origin/develop' into clokep/spaces-pagi…
clokep 466b7d6
Fix typo.
clokep 99627d4
Merge remote-tracking branch 'origin/develop' into clokep/spaces-pagi…
clokep 8ba3e82
Add some documentation to _RoomQueueEntry.
clokep 108c976
Rename the children field of _RoomQueueEntry for clarity.
clokep d92afc5
More comments / refactoring for clarity.
clokep 39c3923
Use a list instead of a deque.
clokep File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add pagination to the spaces summary based on updates to [MSC2946](https://github.com/matrix-org/matrix-doc/pull/2946). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1936,6 +1936,33 @@ async def on_POST( | |
) | ||
|
||
|
||
class FederationRoomHierarchyServlet(BaseFederationServlet): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. single python files should not contain 2158 lines and 59 class definitions. But that is a problem to solve another day. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See #10590 |
||
PREFIX = FEDERATION_UNSTABLE_PREFIX + "/org.matrix.msc2946" | ||
PATH = "/hierarchy/(?P<room_id>[^/]*)" | ||
|
||
def __init__( | ||
self, | ||
hs: HomeServer, | ||
authenticator: Authenticator, | ||
ratelimiter: FederationRateLimiter, | ||
server_name: str, | ||
): | ||
super().__init__(hs, authenticator, ratelimiter, server_name) | ||
self.handler = hs.get_space_summary_handler() | ||
|
||
async def on_GET( | ||
self, | ||
origin: str, | ||
content: Literal[None], | ||
query: Mapping[bytes, Sequence[bytes]], | ||
room_id: str, | ||
) -> Tuple[int, JsonDict]: | ||
suggested_only = parse_boolean_from_args(query, "suggested_only", default=False) | ||
return 200, await self.handler.get_federation_hierarchy( | ||
origin, room_id, suggested_only | ||
) | ||
|
||
|
||
class RoomComplexityServlet(BaseFederationServlet): | ||
""" | ||
Indicates to other servers how complex (and therefore likely | ||
|
@@ -1999,6 +2026,7 @@ async def on_GET( | |
FederationVersionServlet, | ||
RoomComplexityServlet, | ||
FederationSpaceSummaryServlet, | ||
FederationRoomHierarchyServlet, | ||
FederationV1SendKnockServlet, | ||
FederationMakeKnockServlet, | ||
) | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be a follow-up.