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 if search and (filter
or not isinstance(entity, types.InputPeerChannel)): or not isinstance(entity, types.InputPeerChannel)):
# We need to 'search' ourselves unless we have a PeerChannel # We need to 'search' ourselves unless we have a PeerChannel
search = search.lower() search = search.casefold()
self.filter_entity = lambda ent: ( self.filter_entity = lambda ent: (
search in utils.get_display_name(ent).lower() or search in utils.get_display_name(ent).casefold() or
search in (getattr(ent, 'username', '') or None).lower() search in (getattr(ent, 'username', None) or '').casefold()
) )
else: else:
self.filter_entity = lambda ent: True self.filter_entity = lambda ent: True