filtering by name added

This commit is contained in:
ingvar1995 2016-03-02 23:55:12 +03:00
parent 26fcc260df
commit b9937c13cd
2 changed files with 7 additions and 5 deletions

View file

@ -174,8 +174,9 @@ class Profile(Contact):
def filtration(self, show_online=True, filter_str=''):
# TODO: hide elements in list
filter_str = filter_str.lower()
for friend in self._friends:
friend.visibility = (friend.status is not None or not show_online) and (filter_str in friend.name)
friend.visibility = (friend.status is not None or not show_online) and (filter_str in friend.name.lower())
self.show_online, self.filter_string = show_online, filter_str
def get_friend_by_number(self, num):