mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-19 17:56:19 +03:00
Docstring. And small optimisations.
This commit is contained in:
parent
4776528a3f
commit
ff85bbb2d9
1 changed files with 43 additions and 33 deletions
|
@ -133,6 +133,12 @@ class E2eKeysHandler(object):
|
||||||
@opentracing.trace_deferred
|
@opentracing.trace_deferred
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def do_remote_query(destination):
|
def do_remote_query(destination):
|
||||||
|
"""This is called when we are querying the device list of a user on
|
||||||
|
a remote homeserver and their device list is not in the device list
|
||||||
|
cache. If we share a room with this user and we're not querying for
|
||||||
|
specific user we will update the cache
|
||||||
|
with their device list."""
|
||||||
|
|
||||||
destination_query = remote_queries_not_in_cache[destination]
|
destination_query = remote_queries_not_in_cache[destination]
|
||||||
|
|
||||||
opentracing.set_tag("key_query", destination_query)
|
opentracing.set_tag("key_query", destination_query)
|
||||||
|
@ -149,8 +155,12 @@ class E2eKeysHandler(object):
|
||||||
if user_id not in user_ids_updated:
|
if user_id not in user_ids_updated:
|
||||||
try:
|
try:
|
||||||
with PreserveLoggingContext(LoggingContext.current_context()):
|
with PreserveLoggingContext(LoggingContext.current_context()):
|
||||||
|
if not device_list:
|
||||||
room_ids = yield self.store.get_rooms_for_user(user_id)
|
room_ids = yield self.store.get_rooms_for_user(user_id)
|
||||||
if not device_list and room_ids:
|
if room_ids:
|
||||||
|
# We've decided we're sharing a room with this user and should
|
||||||
|
# probably be tracking their device lists. However, we haven't
|
||||||
|
# done an initial sync on the device list so we do it now.
|
||||||
opentracing.log_kv(
|
opentracing.log_kv(
|
||||||
{
|
{
|
||||||
"message": "Resyncing devices for user",
|
"message": "Resyncing devices for user",
|
||||||
|
|
Loading…
Reference in a new issue