summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2021-11-19 18:17:14 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2021-11-19 18:44:25 +0000
commit8f1183cf7b5c52012defa2eede2c9ede8918a2fa (patch)
tree20d8141fe5f72c621eb96fdfe17f81f0033d088d
parentMove stream filter back into AppserviceHandler (diff)
downloadsynapse-8f1183cf7b5c52012defa2eede2c9ede8918a2fa.tar.xz
Broaden type hints; update comment
-rw-r--r--synapse/appservice/scheduler.py10
-rw-r--r--synapse/handlers/appservice.py2
2 files changed, 7 insertions, 5 deletions
diff --git a/synapse/appservice/scheduler.py b/synapse/appservice/scheduler.py
index 6a2ce99b55..45cdee33f4 100644
--- a/synapse/appservice/scheduler.py
+++ b/synapse/appservice/scheduler.py
@@ -48,7 +48,7 @@ This is all tied together by the AppServiceScheduler which DIs the required
 components.
 """
 import logging
-from typing import List, Optional
+from typing import Iterable, List, Optional
 
 from synapse.appservice import ApplicationService, ApplicationServiceState
 from synapse.events import EventBase
@@ -95,8 +95,8 @@ class ApplicationServiceScheduler:
         self.queuer.enqueue_event(service, event)
 
     def submit_ephemeral_events_for_as(
-        self, service: ApplicationService, events: List[JsonDict]
-    ):
+        self, service: ApplicationService, events: Iterable[JsonDict]
+    ) -> None:
         self.queuer.enqueue_ephemeral(service, events)
 
 
@@ -130,7 +130,9 @@ class _ServiceQueuer:
         self.queued_events.setdefault(service.id, []).append(event)
         self._start_background_request(service)
 
-    def enqueue_ephemeral(self, service: ApplicationService, events: List[JsonDict]):
+    def enqueue_ephemeral(
+        self, service: ApplicationService, events: Iterable[JsonDict]
+    ) -> None:
         self.queued_ephemeral.setdefault(service.id, []).extend(events)
         self._start_background_request(service)
 
diff --git a/synapse/handlers/appservice.py b/synapse/handlers/appservice.py
index fb9ad3ba62..1b08ded9fe 100644
--- a/synapse/handlers/appservice.py
+++ b/synapse/handlers/appservice.py
@@ -325,7 +325,7 @@ class ApplicationServicesHandler:
                         )
 
                     elif stream_key == "to_device_key":
-                        # Retrieve an iterable of to-device message events, as well as the
+                        # Retrieve a list of to-device message events, as well as the
                         # maximum stream token of the messages we were able to retrieve.
                         events = await self._handle_to_device(service, new_token, users)
                         if events: