client: Don't check for the room id until we know it's a valid event.

This commit is contained in:
Damir Jelić 2019-04-28 21:16:14 +02:00
parent 0a1008a127
commit 3e67010278

View File

@ -164,14 +164,14 @@ class PanClient(AsyncClient):
# type: (Dict[Any, Any], Optional[str]) -> ()
event = RoomEncryptedEvent.parse_event(event_dict)
if not event.room_id:
event.room_id = room_id
if not isinstance(event, MegolmEvent):
logger.warn("Encrypted event is not a megolm event:"
"\n{}".format(pformat(event_dict)))
return None
if not event.room_id:
event.room_id = room_id
try:
decrypted_event = self.decrypt_event(event)
logger.info("Decrypted event: {}".format(decrypted_event))