Remove empty room events.

This commit is contained in:
poljar (Damir Jelić) 2018-02-24 10:24:19 +01:00
parent add8df517c
commit 542b0bb5af

View file

@ -141,7 +141,7 @@ class RoomInfo():
elif event["type"] == "m.room.power_levels":
other_events.append(RoomPowerLevels.from_dict(event))
return (list(filter(None, membership_events)), other_events)
return (membership_events, other_events)
@classmethod
def from_dict(cls, room_id, parsed_dict):
@ -157,7 +157,8 @@ class RoomInfo():
membership_events.extend(timeline_member_events)
other_events.extend(timeline_events)
return cls(room_id, prev_batch, membership_events, other_events)
return cls(room_id, prev_batch, list(filter(None, membership_events)),
list(filter(None, other_events)))
class RoomEvent():