summary refs log tree commit diff
path: root/synapse/notifier.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-10-19 18:23:05 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2020-10-19 18:23:05 +0100
commitdb233aaa6486302928f1ff6781fe43ad08b66f17 (patch)
tree30dc9c1ea3f6ec72fbe84ccd5cb676647c605048 /synapse/notifier.py
parentMerge commit '04faa0bfa' into anoa/dinsic_release_1_21_x (diff)
parentFix typing for notifier (#8064) (diff)
downloadsynapse-db233aaa6486302928f1ff6781fe43ad08b66f17.tar.xz
Merge commit '9d1e4942a' into anoa/dinsic_release_1_21_x
* commit '9d1e4942a':
  Fix typing for notifier (#8064)
  Add comment explaining cast
  Handle optional dependencies for Oidc and Saml
  Newsfile
  Change HomeServer definition to work with typing.
Diffstat (limited to 'synapse/notifier.py')
-rw-r--r--synapse/notifier.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/synapse/notifier.py b/synapse/notifier.py

index 694efe7116..dfb096e589 100644 --- a/synapse/notifier.py +++ b/synapse/notifier.py
@@ -25,6 +25,7 @@ from typing import ( Set, Tuple, TypeVar, + Union, ) from prometheus_client import Counter @@ -186,7 +187,7 @@ class Notifier(object): self.store = hs.get_datastore() self.pending_new_room_events = ( [] - ) # type: List[Tuple[int, EventBase, Collection[str]]] + ) # type: List[Tuple[int, EventBase, Collection[Union[str, UserID]]]] # Called when there are new things to stream over replication self.replication_callbacks = [] # type: List[Callable[[], None]] @@ -246,7 +247,7 @@ class Notifier(object): event: EventBase, room_stream_id: int, max_room_stream_id: int, - extra_users: Collection[str] = [], + extra_users: Collection[Union[str, UserID]] = [], ): """ Used by handlers to inform the notifier something has happened in the room, room event wise. @@ -282,7 +283,10 @@ class Notifier(object): self._on_new_room_event(event, room_stream_id, extra_users) def _on_new_room_event( - self, event: EventBase, room_stream_id: int, extra_users: Collection[str] = [] + self, + event: EventBase, + room_stream_id: int, + extra_users: Collection[Union[str, UserID]] = [], ): """Notify any user streams that are interested in this room event""" # poke any interested application service. @@ -310,7 +314,7 @@ class Notifier(object): self, stream_key: str, new_token: int, - users: Collection[str] = [], + users: Collection[Union[str, UserID]] = [], rooms: Collection[str] = [], ): """ Used to inform listeners that something has happened event wise.