diff options
author | Richard van der Hoff <richard@matrix.org> | 2018-05-18 11:22:12 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2018-05-18 11:22:12 +0100 |
commit | 011e1f4010776cc67eeead09c20e18da35637c00 (patch) | |
tree | 1bf42540df6f89459d92f6254763a3906846247e /synapse/server_notices/server_notices_manager.py | |
parent | Make sure we reject attempts to invite the notices user (diff) | |
download | synapse-011e1f4010776cc67eeead09c20e18da35637c00.tar.xz |
Better docstrings
Diffstat (limited to 'synapse/server_notices/server_notices_manager.py')
-rw-r--r-- | synapse/server_notices/server_notices_manager.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/synapse/server_notices/server_notices_manager.py b/synapse/server_notices/server_notices_manager.py index 15086600ed..f535b9c9da 100644 --- a/synapse/server_notices/server_notices_manager.py +++ b/synapse/server_notices/server_notices_manager.py @@ -37,10 +37,26 @@ class ServerNoticesManager(object): self._event_creation_handler = hs.get_event_creation_handler() def is_enabled(self): + """Checks if server notices are enabled on this server. + + Returns: + bool + """ return self._config.server_notices_mxid is not None @defer.inlineCallbacks def send_notice(self, user_id, event_content): + """Send a notice to the given user + + Creates the server notices room, if none exists. + + Args: + user_id (str): mxid of user to send event to. + event_content (dict): content of event to send + + Returns: + Deferrred[None] + """ room_id = yield self.get_notice_room_for_user(user_id) system_mxid = self._config.server_notices_mxid |