From 688fdec9d7ebe1bf7d6006e7a8bea5b74b1f3bda Mon Sep 17 00:00:00 2001 From: miruka Date: Fri, 12 Mar 2021 16:12:40 -0400 Subject: [PATCH] Remove callback for nio.UnknownBadEvent Should this type of event appear, our function to register events won't find the attributes required to process it that are present on normal events. --- src/backend/matrix_client.py | 2 +- src/backend/nio_callbacks.py | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/backend/matrix_client.py b/src/backend/matrix_client.py index 2dd764b2..ba6bbf23 100644 --- a/src/backend/matrix_client.py +++ b/src/backend/matrix_client.py @@ -2357,7 +2357,7 @@ class MatrixClient(nio.AsyncClient): async def register_nio_event( self, room: nio.MatrixRoom, - ev: nio.Event, + ev: Union[nio.Event, nio.BadEvent], event_id: str = "", override_fetch_profile: Optional[bool] = None, **fields, diff --git a/src/backend/nio_callbacks.py b/src/backend/nio_callbacks.py index ba01f994..04825645 100644 --- a/src/backend/nio_callbacks.py +++ b/src/backend/nio_callbacks.py @@ -675,13 +675,6 @@ class NioCallbacks: await self.client.register_nio_event(room, ev, content=co) - async def onUnknownBadEvent( - self, room: nio.MatrixRoom, ev: nio.UnknownBadEvent, - ) -> None: - co = "%1 sent a malformed event lacking a minimal structure" - await self.client.register_nio_event(room, ev, content=co) - - async def onUnknownEvent( self, room: nio.MatrixRoom, ev: nio.UnknownEvent, ) -> None: