diff options
author | Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> | 2021-11-02 10:39:02 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-02 10:39:02 +0000 |
commit | c9c3aea9b189cb606d7ec2905dad2c87acc039ef (patch) | |
tree | 1a0a4482d68fc83f36dfce35f5445120bdab32ce /synapse/notifier.py | |
parent | Add search by room ID and room alias to List Room admin API (#11099) (diff) | |
download | synapse-c9c3aea9b189cb606d7ec2905dad2c87acc039ef.tar.xz |
Fix providing a `RoomStreamToken` instance to `_notify_app_services_ephemeral` (#11137)
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
Diffstat (limited to 'synapse/notifier.py')
-rw-r--r-- | synapse/notifier.py | 38 |
1 files changed, 9 insertions, 29 deletions
diff --git a/synapse/notifier.py b/synapse/notifier.py index 1882fffd2a..60e5409895 100644 --- a/synapse/notifier.py +++ b/synapse/notifier.py @@ -383,29 +383,6 @@ class Notifier: except Exception: logger.exception("Error notifying application services of event") - def _notify_app_services_ephemeral( - self, - stream_key: str, - new_token: Union[int, RoomStreamToken], - users: Optional[Collection[Union[str, UserID]]] = None, - ) -> None: - """Notify application services of ephemeral event activity. - - Args: - stream_key: The stream the event came from. - new_token: The value of the new stream token. - users: The users that should be informed of the new event, if any. - """ - try: - stream_token = None - if isinstance(new_token, int): - stream_token = new_token - self.appservice_handler.notify_interested_services_ephemeral( - stream_key, stream_token, users or [] - ) - except Exception: - logger.exception("Error notifying application services of event") - def _notify_pusher_pool(self, max_room_stream_token: RoomStreamToken): try: self._pusher_pool.on_new_notifications(max_room_stream_token) @@ -467,12 +444,15 @@ class Notifier: self.notify_replication() - # Notify appservices - self._notify_app_services_ephemeral( - stream_key, - new_token, - users, - ) + # Notify appservices. + try: + self.appservice_handler.notify_interested_services_ephemeral( + stream_key, + new_token, + users, + ) + except Exception: + logger.exception("Error notifying application services of event") def on_new_replication_data(self) -> None: """Used to inform replication listeners that something has happened |