summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorJonathan de Jong <jonathan@automatia.nl>2021-04-20 12:50:49 +0200
committerGitHub <noreply@github.com>2021-04-20 11:50:49 +0100
commit495b214f4f8f45d16ffee851c8ab7a380dd0e2b2 (patch)
tree1aa4d00ca13939808946f994545dd9f136d2d256 /synapse/handlers
parentPort "Allow users to click account renewal links multiple times without hitti... (diff)
downloadsynapse-495b214f4f8f45d16ffee851c8ab7a380dd0e2b2.tar.xz
Fix (final) Bugbear violations (#9838)
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/auth.py2
-rw-r--r--synapse/handlers/device.py13
-rw-r--r--synapse/handlers/federation.py2
3 files changed, 7 insertions, 10 deletions
diff --git a/synapse/handlers/auth.py b/synapse/handlers/auth.py
index b8a37b6477..36f2450e2e 100644
--- a/synapse/handlers/auth.py
+++ b/synapse/handlers/auth.py
@@ -1248,7 +1248,7 @@ class AuthHandler(BaseHandler):
 
         # see if any of our auth providers want to know about this
         for provider in self.password_providers:
-            for token, token_id, device_id in tokens_and_devices:
+            for token, _, device_id in tokens_and_devices:
                 await provider.on_logged_out(
                     user_id=user_id, device_id=device_id, access_token=token
                 )
diff --git a/synapse/handlers/device.py b/synapse/handlers/device.py
index d75edb184b..c1d7800981 100644
--- a/synapse/handlers/device.py
+++ b/synapse/handlers/device.py
@@ -156,8 +156,7 @@ class DeviceWorkerHandler(BaseHandler):
             # The user may have left the room
             # TODO: Check if they actually did or if we were just invited.
             if room_id not in room_ids:
-                for key, event_id in current_state_ids.items():
-                    etype, state_key = key
+                for etype, state_key in current_state_ids.keys():
                     if etype != EventTypes.Member:
                         continue
                     possibly_left.add(state_key)
@@ -179,8 +178,7 @@ class DeviceWorkerHandler(BaseHandler):
                 log_kv(
                     {"event": "encountered empty previous state", "room_id": room_id}
                 )
-                for key, event_id in current_state_ids.items():
-                    etype, state_key = key
+                for etype, state_key in current_state_ids.keys():
                     if etype != EventTypes.Member:
                         continue
                     possibly_changed.add(state_key)
@@ -198,8 +196,7 @@ class DeviceWorkerHandler(BaseHandler):
             for state_dict in prev_state_ids.values():
                 member_event = state_dict.get((EventTypes.Member, user_id), None)
                 if not member_event or member_event != current_member_id:
-                    for key, event_id in current_state_ids.items():
-                        etype, state_key = key
+                    for etype, state_key in current_state_ids.keys():
                         if etype != EventTypes.Member:
                             continue
                         possibly_changed.add(state_key)
@@ -714,7 +711,7 @@ class DeviceListUpdater:
                 # This can happen since we batch updates
                 return
 
-            for device_id, stream_id, prev_ids, content in pending_updates:
+            for device_id, stream_id, prev_ids, _ in pending_updates:
                 logger.debug(
                     "Handling update %r/%r, ID: %r, prev: %r ",
                     user_id,
@@ -740,7 +737,7 @@ class DeviceListUpdater:
             else:
                 # Simply update the single device, since we know that is the only
                 # change (because of the single prev_id matching the current cache)
-                for device_id, stream_id, prev_ids, content in pending_updates:
+                for device_id, stream_id, _, content in pending_updates:
                     await self.store.update_remote_device_list_cache_entry(
                         user_id, device_id, content, stream_id
                     )
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index 4b3730aa3b..dbdd7d2db3 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -2956,7 +2956,7 @@ class FederationHandler(BaseHandler):
             try:
                 # for each sig on the third_party_invite block of the actual invite
                 for server, signature_block in signed["signatures"].items():
-                    for key_name, encoded_signature in signature_block.items():
+                    for key_name in signature_block.keys():
                         if not key_name.startswith("ed25519:"):
                             continue