Call appservice handler when seeing new events in the notifier

hs/super-wip-edus-down-sync
Will Hunt 2020-09-21 15:10:37 +01:00
parent ae724db899
commit 42090bcc7c
1 changed files with 11 additions and 0 deletions

View File

@ -326,6 +326,12 @@ class Notifier:
except Exception: except Exception:
logger.exception("Error notifying application services of event") logger.exception("Error notifying application services of event")
async def _notify_app_services_ephemeral(self, stream_key: str, new_token: Union[int, RoomStreamToken]):
try:
await self.appservice_handler.notify_interested_services_ephemeral(stream_key, new_token)
except Exception:
logger.exception("Error notifying application services of event")
async def _notify_pusher_pool(self, max_room_stream_id: int): async def _notify_pusher_pool(self, max_room_stream_id: int):
try: try:
await self._pusher_pool.on_new_notifications(max_room_stream_id) await self._pusher_pool.on_new_notifications(max_room_stream_id)
@ -364,6 +370,11 @@ class Notifier:
self.notify_replication() self.notify_replication()
# Notify appservices
run_as_background_process(
"_notify_app_services_ephemeral", self._notify_app_services_ephemeral, stream_key, new_token,
)
def on_new_replication_data(self) -> None: def on_new_replication_data(self) -> None:
"""Used to inform replication listeners that something has happend """Used to inform replication listeners that something has happend
without waking up any of the normal user event streams""" without waking up any of the normal user event streams"""