diff options
author | Richard van der Hoff <richard@matrix.org> | 2018-05-17 17:35:31 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2018-05-22 11:54:51 +0100 |
commit | 9ea219c5143de009c8e411fbb01da1da5ce50829 (patch) | |
tree | bbee714e2ddccebade3e2dc68afd3c3c134a36d3 /synapse/handlers | |
parent | Rename 'version' param on user consent config (diff) | |
download | synapse-9ea219c5143de009c8e411fbb01da1da5ce50829.tar.xz |
Send users a server notice about consent
When a user first syncs, we will send them a server notice asking them to consent to the privacy policy if they have not already done so.
Diffstat (limited to 'synapse/handlers')
-rw-r--r-- | synapse/handlers/presence.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/synapse/handlers/presence.py b/synapse/handlers/presence.py index 91218e40e6..adc816f747 100644 --- a/synapse/handlers/presence.py +++ b/synapse/handlers/presence.py @@ -87,6 +87,11 @@ assert LAST_ACTIVE_GRANULARITY < IDLE_TIMER class PresenceHandler(object): def __init__(self, hs): + """ + + Args: + hs (synapse.server.HomeServer): + """ self.is_mine = hs.is_mine self.is_mine_id = hs.is_mine_id self.clock = hs.get_clock() @@ -94,8 +99,8 @@ class PresenceHandler(object): self.wheel_timer = WheelTimer() self.notifier = hs.get_notifier() self.federation = hs.get_federation_sender() - self.state = hs.get_state_handler() + self._server_notices_sender = hs.get_server_notices_sender() federation_registry = hs.get_federation_registry() @@ -428,6 +433,9 @@ class PresenceHandler(object): last_user_sync_ts=self.clock.time_msec(), )]) + # send any outstanding server notices to the user. + yield self._server_notices_sender.on_user_syncing(user_id) + @defer.inlineCallbacks def _end(): try: |