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
|
return True
|
||||||
|
|
||||||
def set_roster_filter_slow(self, txt):
|
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)
|
self.roster_win.refresh(roster)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def set_roster_filter(self, txt):
|
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)
|
self.roster_win.refresh(roster)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def on_search_terminate(self, txt):
|
def on_search_terminate(self, txt):
|
||||||
curses.curs_set(0)
|
curses.curs_set(0)
|
||||||
roster._contact_filter = None
|
roster.contact_filter = None
|
||||||
self.reset_help_message()
|
self.reset_help_message()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -2805,6 +2805,8 @@ def jid_and_name_match(contact, txt):
|
||||||
return True
|
return True
|
||||||
if txt in JID(contact.bare_jid).user:
|
if txt in JID(contact.bare_jid).user:
|
||||||
return True
|
return True
|
||||||
|
if txt in contact.name:
|
||||||
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def jid_and_name_match_slow(contact, txt):
|
def jid_and_name_match_slow(contact, txt):
|
||||||
|
|
Loading…
Reference in a new issue