Docstring. And small optimisations.

This commit is contained in:
Jorik Schellekens 2019-07-18 16:32:06 +01:00
parent 4776528a3f
commit ff85bbb2d9

View file

@ -133,6 +133,12 @@ class E2eKeysHandler(object):
@opentracing.trace_deferred
@defer.inlineCallbacks
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]
opentracing.set_tag("key_query", destination_query)
@ -149,8 +155,12 @@ class E2eKeysHandler(object):
if user_id not in user_ids_updated:
try:
with PreserveLoggingContext(LoggingContext.current_context()):
if not device_list:
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(
{
"message": "Resyncing devices for user",