File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -222,6 +222,11 @@ async def handle_to_device_event(self, evt: ToDeviceEvent) -> None:
222222 passed to the OlmMachine is syncing. You shouldn't need to call this yourself unless you
223223 do syncing in some manual way.
224224 """
225+ if isinstance (evt , DecryptedOlmEvent ):
226+ self .log .warning (
227+ f"Dropping unexpected nested encrypted to-device event from { evt .sender } "
228+ )
229+ return
225230 self .log .trace (
226231 f"Handling encrypted to-device event from { evt .content .sender_key } ({ evt .sender } )"
227232 )
@@ -230,6 +235,8 @@ async def handle_to_device_event(self, evt: ToDeviceEvent) -> None:
230235 await self ._receive_room_key (decrypted_evt )
231236 elif decrypted_evt .type == EventType .FORWARDED_ROOM_KEY :
232237 await self ._receive_forwarded_room_key (decrypted_evt )
238+ else :
239+ self .client .dispatch_event (decrypted_evt , source = evt .source )
233240
234241 async def _receive_room_key (self , evt : DecryptedOlmEvent ) -> None :
235242 # TODO nio had a comment saying "handle this better"
You can’t perform that action at this time.
0 commit comments