From e6e996997ff013547a4f9728bab0ca7b1bc1343c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?poljar=20=28Damir=20Jeli=C4=87=29?= Date: Mon, 18 Jun 2018 20:41:46 +0200 Subject: [PATCH] rooms: Encrypted events can be redacted as well. --- matrix/rooms.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/matrix/rooms.py b/matrix/rooms.py index 3313f12..86c616d 100644 --- a/matrix/rooms.py +++ b/matrix/rooms.py @@ -250,7 +250,9 @@ class RoomInfo(): state_event = None message_event = None - if event_dict["type"] == "m.room.message": + if "redacted_by" in event_dict["unsigned"]: + message_event = RoomRedactedMessageEvent.from_dict(event_dict) + elif event_dict["type"] == "m.room.message": message_event = RoomInfo._message_from_event(event_dict) elif event_dict["type"] == "m.room.member": state_event, message_event = ( @@ -309,10 +311,11 @@ class RoomInfo(): message_events.append(s_event) except (ValueError, TypeError, KeyError) as error: message = ("{prefix}matrix: Error parsing " - "room event of type {type}: {error}").format( + "room event of type {type}: {error}\n{event}").format( prefix=W.prefix("error"), type=event["type"], - error=pformat(error)) + error=pformat(error), + event=pformat(event)) W.prnt("", message) raise