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

Commit

Permalink
Expose http_client and public_room_list_manager as properties
Browse files Browse the repository at this point in the history
  • Loading branch information
anoadragon453 committed Sep 28, 2020
1 parent e5b2d20 commit 5730d17
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions synapse/module_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,26 @@ def __init__(self, hs, auth_handler):
self._auth = hs.get_auth()
self._auth_handler = auth_handler

self.http_client = hs.get_simple_http_client() # type: SimpleHttpClient
self.public_room_list_manager = PublicRoomListManager(hs)
# We expose these as properties below in order to attach a helpful docstring.
self._http_client = hs.get_simple_http_client() # type: SimpleHttpClient
self._public_room_list_manager = PublicRoomListManager(hs)

@property
def http_client(self):
"""Allows making outbound HTTP requests to remote resources.
An instance of synapse.http.client.SimpleHttpClient
"""
return self._http_client

@property
def public_room_list_manager(self):
"""Allows adding to, removing from and checking the status of rooms in the
public room list.
An instance of synapse.module_api.PublicRoomListManager
"""
return self._public_room_list_manager

def get_user_by_req(self, req, allow_guest=False):
"""Check the access_token provided for a request
Expand Down

0 comments on commit 5730d17

Please sign in to comment.