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.
This commit is contained in:
Richard van der Hoff 2018-05-17 17:35:31 +01:00
parent d14d7b8fdc
commit 9ea219c514
11 changed files with 255 additions and 11 deletions

View file

@ -69,6 +69,7 @@ class ReplicationStreamer(object):
self.presence_handler = hs.get_presence_handler()
self.clock = hs.get_clock()
self.notifier = hs.get_notifier()
self._server_notices_sender = hs.get_server_notices_sender()
# Current connections.
self.connections = []
@ -253,6 +254,7 @@ class ReplicationStreamer(object):
yield self.store.insert_client_ip(
user_id, access_token, ip, user_agent, device_id, last_seen,
)
yield self._server_notices_sender.on_user_ip(user_id)
def send_sync_to_all_connections(self, data):
"""Sends a SYNC command to all clients.