From 3ff0e1bd70bdf2af3bf6204b0db8263280508de8 Mon Sep 17 00:00:00 2001 From: miruka Date: Sat, 6 Jul 2019 22:38:56 -0400 Subject: [PATCH] Use nio RoomMemberEvent new attrs --- src/python/matrix_client.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/python/matrix_client.py b/src/python/matrix_client.py index 9daa2b62..c61d4977 100644 --- a/src/python/matrix_client.py +++ b/src/python/matrix_client.py @@ -275,9 +275,9 @@ class MatrixClient(nio.AsyncClient): async def _get_room_member_event_content(self, ev) -> Optional[str]: prev = ev.prev_content - prev_membership = prev["membership"] if prev else None now = ev.content - membership = now["membership"] + membership = ev.membership + prev_membership = ev.prev_membership if not prev or membership != prev_membership: reason = f" Reason: {now['reason']}" if now.get("reason") else "" @@ -337,7 +337,7 @@ class MatrixClient(nio.AsyncClient): async def onRoomMemberEvent(self, room, ev, from_past=False) -> None: - if not from_past and ev.content["membership"] != "leave": + if not from_past and ev.membership != "leave": users.UserUpdated( user_id = ev.state_key, display_name = ev.content["displayname"] or "",