From a98b8583c647d841b49b94a3de030b9e8d5271c0 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Tue, 3 Sep 2019 19:58:51 +0100 Subject: [PATCH 1/3] Remove unnecessary variable declaration --- synapse/handlers/register.py | 1 - 1 file changed, 1 deletion(-) diff --git a/synapse/handlers/register.py b/synapse/handlers/register.py index 3142d85788f1..1711d5ac5c74 100644 --- a/synapse/handlers/register.py +++ b/synapse/handlers/register.py @@ -397,7 +397,6 @@ def _generate_user_id(self, reseed=False): @defer.inlineCallbacks def _join_user_to_room(self, requester, room_identifier): - room_id = None room_member_handler = self.hs.get_room_member_handler() if RoomID.is_valid(room_identifier): room_id = room_identifier From 6b6086b8bf8d222e528002009d921804d306d85d Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Tue, 3 Sep 2019 20:00:09 +0100 Subject: [PATCH 2/3] Fix docstring --- synapse/handlers/register.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/synapse/handlers/register.py b/synapse/handlers/register.py index 1711d5ac5c74..e59b2a368459 100644 --- a/synapse/handlers/register.py +++ b/synapse/handlers/register.py @@ -681,8 +681,7 @@ def _register_msisdn_threepid(self, user_id, threepid, bind_msisdn): Args: user_id (str): id of user threepid (object): m.login.msisdn auth response - token (str): access_token for the user - bind_email (bool): true if the client requested the email to be + bind_msisdn (bool): true if the client requested the msisdn to be bound at the identity server Returns: defer.Deferred: From 2f416fc9976acf482163bba82e13b7d749e1c290 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 3 Sep 2019 13:35:20 -0600 Subject: [PATCH 3/3] Ensure the list media admin API is always available (#5966) * Ensure the list media admin API is always available This API is required for some external media repo implementations to operate (mostly for doing quarantine operations on a room). * changelog --- changelog.d/5966.bugfix | 1 + synapse/rest/admin/__init__.py | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 changelog.d/5966.bugfix diff --git a/changelog.d/5966.bugfix b/changelog.d/5966.bugfix new file mode 100644 index 000000000000..b8ef5a7819c3 --- /dev/null +++ b/changelog.d/5966.bugfix @@ -0,0 +1 @@ +Fix admin API for listing media in a room not being available with an external media repo. diff --git a/synapse/rest/admin/__init__.py b/synapse/rest/admin/__init__.py index b4761adaedd9..81b6bd881676 100644 --- a/synapse/rest/admin/__init__.py +++ b/synapse/rest/admin/__init__.py @@ -41,7 +41,7 @@ assert_user_is_admin, historical_admin_path_patterns, ) -from synapse.rest.admin.media import register_servlets_for_media_repo +from synapse.rest.admin.media import ListMediaInRoom, register_servlets_for_media_repo from synapse.rest.admin.purge_room_servlet import PurgeRoomServlet from synapse.rest.admin.server_notice_servlet import SendServerNoticeServlet from synapse.rest.admin.users import UserAdminServlet @@ -761,9 +761,12 @@ def register_servlets_for_client_rest_resource(hs, http_server): DeleteGroupAdminRestServlet(hs).register(http_server) AccountValidityRenewServlet(hs).register(http_server) - # Load the media repo ones if we're using them. + # Load the media repo ones if we're using them. Otherwise load the servlets which + # don't need a media repo (typically readonly admin APIs). if hs.config.can_load_media_repo: register_servlets_for_media_repo(hs, http_server) + else: + ListMediaInRoom(hs).register(http_server) # don't add more things here: new servlets should only be exposed on # /_synapse/admin so should not go here. Instead register them in AdminRestResource.