summary refs log tree commit diff
path: root/synapse/handlers/device.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-10-22 10:41:18 +0100
committerErik Johnston <erik@matrix.org>2019-10-22 10:41:18 +0100
commitbb6264be0b13314123b4fd047fe180616e8f0efa (patch)
treee06f393f38b4aea65101fbcdc0637e719b285727 /synapse/handlers/device.py
parentFix packaging (diff)
parentDelete format_tap.py (#6219) (diff)
downloadsynapse-bb6264be0b13314123b4fd047fe180616e8f0efa.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/refactor_stores
Diffstat (limited to 'synapse/handlers/device.py')
-rw-r--r--synapse/handlers/device.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/synapse/handlers/device.py b/synapse/handlers/device.py
index 71a8f33da3..5f23ee4488 100644
--- a/synapse/handlers/device.py
+++ b/synapse/handlers/device.py
@@ -1,5 +1,7 @@
 # -*- coding: utf-8 -*-
 # Copyright 2016 OpenMarket Ltd
+# Copyright 2019 New Vector Ltd
+# Copyright 2019 The Matrix.org Foundation C.I.C.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -439,6 +441,21 @@ class DeviceHandler(DeviceWorkerHandler):
                 log_kv({"message": "sent device update to host", "host": host})
 
     @defer.inlineCallbacks
+    def notify_user_signature_update(self, from_user_id, user_ids):
+        """Notify a user that they have made new signatures of other users.
+
+        Args:
+            from_user_id (str): the user who made the signature
+            user_ids (list[str]): the users IDs that have new signatures
+        """
+
+        position = yield self.store.add_user_signature_change_to_streams(
+            from_user_id, user_ids
+        )
+
+        self.notifier.on_new_event("device_list_key", position, users=[from_user_id])
+
+    @defer.inlineCallbacks
     def on_federation_query_user_devices(self, user_id):
         stream_id, devices = yield self.store.get_devices_with_keys_by_user(user_id)
         return {"user_id": user_id, "stream_id": stream_id, "devices": devices}