Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Use the import style.
Browse files Browse the repository at this point in the history
  • Loading branch information
JorikSchellekens committed Aug 16, 2019
1 parent 3a29b2a commit ae5315c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions synapse/handlers/devicemessage.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from synapse.api.errors import SynapseError
from synapse.logging.opentracing import (
get_active_span_text_map,
log_kv,
set_tag,
start_active_span,
whitelisted_homeserver,
Expand Down Expand Up @@ -86,8 +87,8 @@ def on_direct_to_device_edu(self, origin, content):

@defer.inlineCallbacks
def send_device_message(self, sender_user_id, message_type, messages):
opentracing.set_tag("number_of_messages", len(messages))
opentracing.set_tag("sender", sender_user_id)
set_tag("number_of_messages", len(messages))
set_tag("sender", sender_user_id)
local_messages = {}
remote_messages = {}
for user_id, by_device in messages.items():
Expand Down Expand Up @@ -125,7 +126,7 @@ def send_device_message(self, sender_user_id, message_type, messages):
else None,
}

opentracing.log_kv({"local_messages": local_messages})
log_kv({"local_messages": local_messages})
stream_id = yield self.store.add_messages_to_device_inbox(
local_messages, remote_edu_contents
)
Expand All @@ -134,7 +135,7 @@ def send_device_message(self, sender_user_id, message_type, messages):
"to_device_key", stream_id, users=local_messages.keys()
)

opentracing.log_kv({"remote_messages": remote_messages})
log_kv({"remote_messages": remote_messages})
for destination in remote_messages.keys():
# Enqueue a new federation transaction to send the new
# device messages to each remote destination.
Expand Down

0 comments on commit ae5315c

Please sign in to comment.