rooms: Encrypted events can be redacted as well.

This commit is contained in:
poljar (Damir Jelić) 2018-06-18 20:41:46 +02:00
parent 90a9e607b1
commit e6e996997f

View file

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