Update the roster search functions
This commit is contained in:
parent
2957cded91
commit
7c8fe132eb
1 changed files with 5 additions and 3 deletions
|
@ -2187,18 +2187,18 @@ class RosterInfoTab(Tab):
|
|||
return True
|
||||
|
||||
def set_roster_filter_slow(self, txt):
|
||||
roster._contact_filter = (jid_and_name_match_slow, txt)
|
||||
roster.jids_filter = (jid_and_name_match_slow, txt)
|
||||
self.roster_win.refresh(roster)
|
||||
return False
|
||||
|
||||
def set_roster_filter(self, txt):
|
||||
roster._contact_filter = (jid_and_name_match, txt)
|
||||
roster.contact_filter = (jid_and_name_match, txt)
|
||||
self.roster_win.refresh(roster)
|
||||
return False
|
||||
|
||||
def on_search_terminate(self, txt):
|
||||
curses.curs_set(0)
|
||||
roster._contact_filter = None
|
||||
roster.contact_filter = None
|
||||
self.reset_help_message()
|
||||
return False
|
||||
|
||||
|
@ -2805,6 +2805,8 @@ def jid_and_name_match(contact, txt):
|
|||
return True
|
||||
if txt in JID(contact.bare_jid).user:
|
||||
return True
|
||||
if txt in contact.name:
|
||||
return True
|
||||
return False
|
||||
|
||||
def jid_and_name_match_slow(contact, txt):
|
||||
|
|
Loading…
Reference in a new issue