From 0a47d1929a54f901a3524169c6e52f9983ef1f7a Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Wed, 8 Sep 2021 20:31:40 +0300 Subject: [PATCH] Don't re-wrap events if they're re-dispatched --- maubot/matrix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maubot/matrix.py b/maubot/matrix.py index f93b80d..beca521 100644 --- a/maubot/matrix.py +++ b/maubot/matrix.py @@ -126,7 +126,7 @@ class MaubotMatrixClient(MatrixClient): return self.send_message(room_id, content, **kwargs) def dispatch_event(self, event: Event, source: SyncStream) -> List[asyncio.Task]: - if isinstance(event, MessageEvent): + if isinstance(event, MessageEvent) and not isinstance(event, MaubotMessageEvent): event = MaubotMessageEvent(event, self) elif source != SyncStream.INTERNAL: event.client = self