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, added_by=True,
users=msg.from_id) users=msg.from_id)
elif isinstance(action, types.MessageActionChatAddUser): elif isinstance(action, types.MessageActionChatAddUser):
# If a user adds itself, it means they joined # If a user adds itself, it means they joined via the public chat username
added_by = ([utils.get_peer_id(msg.from_id)] == action.users) or msg.from_id added_by = ([msg.sender_id] == action.users) or msg.from_id
return cls.Event(msg, return cls.Event(msg,
added_by=added_by, added_by=added_by,
users=action.users) users=action.users)