Fix iter_participants search on small group chats

This commit is contained in:
Lonami Exo 2019-05-20 14:02:51 +02:00
parent 465f38c1c6
commit a9ff328e38

View File

@ -109,11 +109,11 @@ class _ParticipantsIter(RequestIter):
if search and (filter
or not isinstance(entity, types.InputPeerChannel)):
# We need to 'search' ourselves unless we have a PeerChannel
search = search.lower()
search = search.casefold()
self.filter_entity = lambda ent: (
search in utils.get_display_name(ent).lower() or
search in (getattr(ent, 'username', '') or None).lower()
search in utils.get_display_name(ent).casefold() or
search in (getattr(ent, 'username', None) or '').casefold()
)
else:
self.filter_entity = lambda ent: True