summary refs log tree commit diff
path: root/synapse/handlers/account_data.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2020-10-09 07:20:51 -0400
committerGitHub <noreply@github.com>2020-10-09 07:20:51 -0400
commita93f3121f8fd1c2b77e003d8e43ce881635bb098 (patch)
tree2abb73eb4b3fe2334ab5b2c162c1224189740959 /synapse/handlers/account_data.py
parentInvalidate the cache when an olm fallback key is uploaded (#8501) (diff)
downloadsynapse-a93f3121f8fd1c2b77e003d8e43ce881635bb098.tar.xz
Add type hints to some handlers (#8505)
Diffstat (limited to 'synapse/handlers/account_data.py')
-rw-r--r--synapse/handlers/account_data.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/synapse/handlers/account_data.py b/synapse/handlers/account_data.py
index 9112a0ab86..341135822e 100644
--- a/synapse/handlers/account_data.py
+++ b/synapse/handlers/account_data.py
@@ -12,16 +12,24 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+from typing import TYPE_CHECKING, List, Tuple
+
+from synapse.types import JsonDict, UserID
+
+if TYPE_CHECKING:
+    from synapse.app.homeserver import HomeServer
 
 
 class AccountDataEventSource:
-    def __init__(self, hs):
+    def __init__(self, hs: "HomeServer"):
         self.store = hs.get_datastore()
 
-    def get_current_key(self, direction="f"):
+    def get_current_key(self, direction: str = "f") -> int:
         return self.store.get_max_account_data_stream_id()
 
-    async def get_new_events(self, user, from_key, **kwargs):
+    async def get_new_events(
+        self, user: UserID, from_key: int, **kwargs
+    ) -> Tuple[List[JsonDict], int]:
         user_id = user.to_string()
         last_stream_id = from_key