From b9fc3556c74d020dfa087f7281008f17077b3acf Mon Sep 17 00:00:00 2001 From: Yann Leboulanger <asterix@lagaule.org> Date: Fri, 1 Aug 2008 10:26:29 +0000 Subject: [PATCH] [avm] allow to search contact in roster by typing the middle of the name, not only the begining --- src/roster_window.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/roster_window.py b/src/roster_window.py index 9ac02fda0f..9e457629d1 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -1418,10 +1418,9 @@ class RosterWindow: ############################################################################## def _search_roster_func(self, model, column, key, titer): - if model[titer][C_NAME].decode('utf-8').lower().startswith( - gobject.markup_escape_text(key.lower())): - return False - return True + key = gobject.markup_escape_text(key.lower()) + name = model[titer][C_NAME].decode('utf-8').lower() + return not (key in name) def refilter_shown_roster_items(self): self.filtering = True -- GitLab