From dcdfa6f46d4c2ebc2075547899bf22b91b841e82 Mon Sep 17 00:00:00 2001 From: "Olivier Wilkinson (reivilibre)" Date: Wed, 1 Dec 2021 15:00:13 +0000 Subject: [PATCH] Add type aliases for one-time key counts and unused fallback keys that will be sent --- synapse/appservice/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/synapse/appservice/__init__.py b/synapse/appservice/__init__.py index 9672e34f92..811f21d634 100644 --- a/synapse/appservice/__init__.py +++ b/synapse/appservice/__init__.py @@ -27,6 +27,14 @@ if TYPE_CHECKING: logger = logging.getLogger(__name__) +# Type for the `device_one_time_key_counts` field in an appservice transaction +# user ID -> {device ID -> {algorithm -> count}} +TransactionOneTimeKeyCounts = Dict[str, Dict[str, Dict[str, int]]] + +# Type for the `device_unused_fallback_keys` field in an appservice transaction +# user ID -> {device ID -> [algorithm]} +TransactionUnusedFallbackKeys = Dict[str, Dict[str, List[str]]] + class ApplicationServiceState(Enum): DOWN = "down"