mirror of
https://mau.dev/maunium/synapse.git
synced 2024-11-05 22:28:54 +01:00
Better docstrings
This commit is contained in:
parent
26305788fe
commit
011e1f4010
1 changed files with 16 additions and 0 deletions
|
@ -37,10 +37,26 @@ class ServerNoticesManager(object):
|
||||||
self._event_creation_handler = hs.get_event_creation_handler()
|
self._event_creation_handler = hs.get_event_creation_handler()
|
||||||
|
|
||||||
def is_enabled(self):
|
def is_enabled(self):
|
||||||
|
"""Checks if server notices are enabled on this server.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
bool
|
||||||
|
"""
|
||||||
return self._config.server_notices_mxid is not None
|
return self._config.server_notices_mxid is not None
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def send_notice(self, user_id, event_content):
|
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)
|
room_id = yield self.get_notice_room_for_user(user_id)
|
||||||
|
|
||||||
system_mxid = self._config.server_notices_mxid
|
system_mxid = self._config.server_notices_mxid
|
||||||
|
|
Loading…
Reference in a new issue