diff --git a/changelog.d/5858.feature b/changelog.d/5858.feature index 24e60eac80..93e44bf9b3 100644 --- a/changelog.d/5858.feature +++ b/changelog.d/5858.feature @@ -1 +1 @@ -Add hash and count fields key backup endpoints to help clients guess if there are new keys. \ No newline at end of file +Add hash and count fields to key backup endpoints to help clients guess if there are new keys. diff --git a/synapse/handlers/e2e_room_keys.py b/synapse/handlers/e2e_room_keys.py index a4567dcfaf..9e40ee7961 100644 --- a/synapse/handlers/e2e_room_keys.py +++ b/synapse/handlers/e2e_room_keys.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Copyright 2017, 2018 New Vector Ltd -# Copyright 2019 Matrix.org Foundation CIC +# Copyright 2019 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. diff --git a/synapse/storage/e2e_room_keys.py b/synapse/storage/e2e_room_keys.py index 3f0a917b43..a10ee71fe7 100644 --- a/synapse/storage/e2e_room_keys.py +++ b/synapse/storage/e2e_room_keys.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Copyright 2017 New Vector Ltd -# Copyright 2019 Matrix.org Foundation CIC +# Copyright 2019 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. @@ -156,7 +156,7 @@ class EndToEndRoomKeyStore(SQLBaseStore): want to query Returns: - dict[dict[dict]]: a map of room IDs to session IDs to room key + Deferred[dict[dict[dict]]]: a map of room IDs to session IDs to room key """ return self.runInteraction( @@ -176,7 +176,7 @@ class EndToEndRoomKeyStore(SQLBaseStore): params = [user_id, version] for room_id, room in room_keys.items(): sessions = list(room["sessions"]) - if not len(sessions): + if not sessions: continue params.append(room_id) params.extend(sessions) diff --git a/synapse/storage/schema/delta/56/room_key_hash.sql b/synapse/storage/schema/delta/56/room_key_hash.sql index be2a559b6e..74e1b72446 100644 --- a/synapse/storage/schema/delta/56/room_key_hash.sql +++ b/synapse/storage/schema/delta/56/room_key_hash.sql @@ -1,4 +1,4 @@ -/* Copyright 2019 Matrix.org Foundation CIC +/* Copyright 2019 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. diff --git a/tests/handlers/test_e2e_room_keys.py b/tests/handlers/test_e2e_room_keys.py index 0e3bf70749..6d03342a4f 100644 --- a/tests/handlers/test_e2e_room_keys.py +++ b/tests/handlers/test_e2e_room_keys.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Copyright 2016 OpenMarket Ltd # Copyright 2017 New Vector Ltd -# Copyright 2019 Matrix.org Foundation CIC +# Copyright 2019 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.