Ignore member events where prev_content == content

This commit is contained in:
miruka 2019-09-02 13:21:46 -04:00
parent d5dbb1368f
commit 175caba2e9

View File

@ -639,6 +639,10 @@ class MatrixClient(nio.AsyncClient):
async def process_room_member_event( async def process_room_member_event(
self, room, ev, self, room, ev,
) -> Optional[Tuple[TypeSpecifier, str]]: ) -> Optional[Tuple[TypeSpecifier, str]]:
if ev.prev_content == ev.content:
return None
prev = ev.prev_content prev = ev.prev_content
now = ev.content now = ev.content
membership = ev.membership membership = ev.membership
@ -718,8 +722,7 @@ class MatrixClient(nio.AsyncClient):
"%1 changed their {}.".format(" and ".join(changed)), "%1 changed their {}.".format(" and ".join(changed)),
) )
log.warning("Invalid member event - %s", log.warning("Unknown member event: %s", json.dumps(vars(ev), indent=4))
json.dumps(vars(ev), indent=4))
return None return None