mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-24 18:45:52 +03:00
Rename things
This commit is contained in:
parent
878d427d20
commit
3182f6b32b
3 changed files with 10 additions and 10 deletions
|
@ -630,7 +630,7 @@ class E2eKeysHandler:
|
||||||
]
|
]
|
||||||
|
|
||||||
otk_results, not_found = await self.store.claim_e2e_one_time_keys(local_query)
|
otk_results, not_found = await self.store.claim_e2e_one_time_keys(local_query)
|
||||||
self._notifier.notify_one_time_keys_claimed(otk_results.keys())
|
self._notifier.notify_one_time_keys_changed(otk_results.keys())
|
||||||
|
|
||||||
# If the application services have not provided any keys via the C-S
|
# If the application services have not provided any keys via the C-S
|
||||||
# API, query it directly for one-time keys.
|
# API, query it directly for one-time keys.
|
||||||
|
@ -641,7 +641,7 @@ class E2eKeysHandler:
|
||||||
appservice_results,
|
appservice_results,
|
||||||
not_found,
|
not_found,
|
||||||
) = await self._appservice_handler.claim_e2e_one_time_keys(not_found)
|
) = await self._appservice_handler.claim_e2e_one_time_keys(not_found)
|
||||||
self._notifier.notify_one_time_keys_claimed(appservice_results.keys())
|
self._notifier.notify_one_time_keys_changed(appservice_results.keys())
|
||||||
else:
|
else:
|
||||||
appservice_results = {}
|
appservice_results = {}
|
||||||
|
|
||||||
|
@ -696,7 +696,7 @@ class E2eKeysHandler:
|
||||||
# For each user that does not have a one-time keys available, see if
|
# For each user that does not have a one-time keys available, see if
|
||||||
# there is a fallback key.
|
# there is a fallback key.
|
||||||
fallback_results = await self.store.claim_e2e_fallback_keys(fallback_query)
|
fallback_results = await self.store.claim_e2e_fallback_keys(fallback_query)
|
||||||
self._notifier.notify_one_time_keys_claimed(fallback_results.keys())
|
self._notifier.notify_one_time_keys_changed(fallback_results.keys())
|
||||||
|
|
||||||
# Return the results in order, each item from the input query should
|
# Return the results in order, each item from the input query should
|
||||||
# only appear once in the combined list.
|
# only appear once in the combined list.
|
||||||
|
|
|
@ -902,13 +902,13 @@ class Notifier:
|
||||||
for cb in self._lock_released_callback:
|
for cb in self._lock_released_callback:
|
||||||
cb(instance_name, lock_name, lock_key)
|
cb(instance_name, lock_name, lock_key)
|
||||||
|
|
||||||
def notify_one_time_keys_claimed(
|
def notify_one_time_keys_changed(
|
||||||
self,
|
self,
|
||||||
users: Union[StrCollection, Collection[UserID]],
|
users: Union[StrCollection, Collection[UserID]],
|
||||||
) -> None:
|
) -> None:
|
||||||
"""
|
"""
|
||||||
Used by handlers to inform the notifier that a one-time key has been
|
Used by handlers to inform the notifier that a one-time key has been
|
||||||
claimed
|
claimed or uploaded
|
||||||
"""
|
"""
|
||||||
# Bail early if there is nothing to do
|
# Bail early if there is nothing to do
|
||||||
if not users:
|
if not users:
|
||||||
|
|
|
@ -278,8 +278,8 @@ class SlidingSyncE2eeExtensionTestCase(SlidingSyncBase):
|
||||||
test_device_id,
|
test_device_id,
|
||||||
{
|
{
|
||||||
"fallback_keys": {
|
"fallback_keys": {
|
||||||
"alg1:k1": "fallback_key1",
|
"fallback_alg1:k1": "fallback_key1",
|
||||||
"alg2:k2": "fallback_key2",
|
"fallback_alg2:k2": "fallback_key2",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -290,7 +290,7 @@ class SlidingSyncE2eeExtensionTestCase(SlidingSyncBase):
|
||||||
)
|
)
|
||||||
self.assertIncludes(
|
self.assertIncludes(
|
||||||
set(fallback_res),
|
set(fallback_res),
|
||||||
{"alg1", "alg2"},
|
{"fallback_alg1", "fallback_alg2"},
|
||||||
exact=True,
|
exact=True,
|
||||||
message=str(fallback_res),
|
message=str(fallback_res),
|
||||||
)
|
)
|
||||||
|
@ -298,7 +298,7 @@ class SlidingSyncE2eeExtensionTestCase(SlidingSyncBase):
|
||||||
# Claim one of those fallback keys
|
# Claim one of those fallback keys
|
||||||
self.get_success(
|
self.get_success(
|
||||||
self.e2e_keys_handler.claim_local_one_time_keys(
|
self.e2e_keys_handler.claim_local_one_time_keys(
|
||||||
local_query=[(user1_id, test_device_id, "alg1", 1)],
|
local_query=[(user1_id, test_device_id, "fallback_alg1", 1)],
|
||||||
always_include_fallback_keys=False,
|
always_include_fallback_keys=False,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -358,7 +358,7 @@ class SlidingSyncE2eeExtensionTestCase(SlidingSyncBase):
|
||||||
"device_unused_fallback_key_types", []
|
"device_unused_fallback_key_types", []
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
{"alg2"},
|
{"fallback_alg2"},
|
||||||
exact=True,
|
exact=True,
|
||||||
message=str(
|
message=str(
|
||||||
channel.json_body["extensions"]["e2ee"].get(
|
channel.json_body["extensions"]["e2ee"].get(
|
||||||
|
|
Loading…
Reference in a new issue