diff options
author | Sean Quah <8349537+squahtx@users.noreply.github.com> | 2021-10-12 13:50:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-12 13:50:34 +0100 |
commit | 36224e056a0ba91b4541607c5ad5cd5152d0e672 (patch) | |
tree | 6af593892cdf674eebb7ad15a09461ab76b9fcea /synapse/handlers/device.py | |
parent | Merge tag 'v1.45.0rc1' into develop (diff) | |
download | synapse-36224e056a0ba91b4541607c5ad5cd5152d0e672.tar.xz |
Add type hints to `synapse.storage.databases.main.client_ips` (#10972)
Diffstat (limited to 'synapse/handlers/device.py')
-rw-r--r-- | synapse/handlers/device.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/synapse/handlers/device.py b/synapse/handlers/device.py index 75e6019760..6eafbea25d 100644 --- a/synapse/handlers/device.py +++ b/synapse/handlers/device.py @@ -14,7 +14,18 @@ # See the License for the specific language governing permissions and # limitations under the License. import logging -from typing import TYPE_CHECKING, Collection, Dict, Iterable, List, Optional, Set, Tuple +from typing import ( + TYPE_CHECKING, + Any, + Collection, + Dict, + Iterable, + List, + Mapping, + Optional, + Set, + Tuple, +) from synapse.api import errors from synapse.api.constants import EventTypes @@ -595,7 +606,7 @@ class DeviceHandler(DeviceWorkerHandler): def _update_device_from_client_ips( - device: JsonDict, client_ips: Dict[Tuple[str, str], JsonDict] + device: JsonDict, client_ips: Mapping[Tuple[str, str], Mapping[str, Any]] ) -> None: ip = client_ips.get((device["user_id"], device["device_id"]), {}) device.update({"last_seen_ts": ip.get("last_seen"), "last_seen_ip": ip.get("ip")}) |