Fix ChatAction check for self-user joining a chat

This commit is contained in:
Lonami Exo 2020-10-07 10:39:02 +02:00
parent 026c992395
commit e28fbc6678

View File

@ -77,8 +77,8 @@ class ChatAction(EventBuilder):
added_by=True,
users=msg.from_id)
elif isinstance(action, types.MessageActionChatAddUser):
# If a user adds itself, it means they joined
added_by = ([utils.get_peer_id(msg.from_id)] == action.users) or msg.from_id
# If a user adds itself, it means they joined via the public chat username
added_by = ([msg.sender_id] == action.users) or msg.from_id
return cls.Event(msg,
added_by=added_by,
users=action.users)