Don't re-wrap events if they're re-dispatched

This commit is contained in:
Tulir Asokan 2021-09-08 20:31:40 +03:00
parent ebd4ae9f55
commit 0a47d1929a

View file

@ -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