Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Use MSC2197 on stable prefix as it has almost finished FCP
Browse files Browse the repository at this point in the history
Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
  • Loading branch information
reivilibre committed Aug 20, 2019
1 parent a3df04a commit bb29bc2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 26 deletions.
4 changes: 2 additions & 2 deletions synapse/federation/transport/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,8 @@ def get_public_rooms(
third_party_instance_id=None,
):
if search_filter:
# TODO(MSC2197): Move to V1 prefix
path = _create_path(FEDERATION_UNSTABLE_PREFIX, "/publicRooms")
# this uses MSC2197 (Search Filtering over Federation)
path = _create_v1_path("/publicRooms")

data = {"include_all_networks": "true" if include_all_networks else "false"}
if third_party_instance_id:
Expand Down
26 changes: 2 additions & 24 deletions synapse/federation/transport/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,30 +750,8 @@ async def on_GET(self, origin, content, query):
)
return 200, data


class UnstablePublicRoomList(BaseFederationServlet):
"""
Fetch the public room list for this server.
This API returns information in the same format as /publicRooms on the
client API, but will only ever include local public rooms and hence is
intended for consumption by other home servers.
This is the unstable-prefixed version which adds support for MSC2197, which
is still undergoing review.
"""

PATH = "/publicRooms"
PREFIX = FEDERATION_UNSTABLE_PREFIX

def __init__(self, handler, authenticator, ratelimiter, server_name, allow_access):
super(UnstablePublicRoomList, self).__init__(
handler, authenticator, ratelimiter, server_name
)
self.allow_access = allow_access

# TODO(MSC2197): Move away from Unstable prefix and back to normal prefix
async def on_POST(self, origin, content, query):
# This implements MSC2197 (Search Filtering over Federation)
if not self.allow_access:
raise FederationDeniedError(origin)

Expand Down Expand Up @@ -1373,7 +1351,7 @@ async def on_GET(self, origin, content, query, room_id):

OPENID_SERVLET_CLASSES = (OpenIdUserInfo,)

ROOM_LIST_CLASSES = (PublicRoomList, UnstablePublicRoomList)
ROOM_LIST_CLASSES = (PublicRoomList,)

GROUP_SERVER_SERVLET_CLASSES = (
FederationGroupsProfileServlet,
Expand Down

0 comments on commit bb29bc2

Please sign in to comment.