aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-ui-utils.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-06-01 17:06:28 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-06-01 17:48:49 +0800
commitdb6773ebf31853608353b1bb156156879b303569 (patch)
treef5f14546828f7ffdf42a11fc40a34f1e05ac437c /libempathy-gtk/empathy-ui-utils.c
parentcc6c2b5423c3a1906b5f484c157bc67dd9ee9d86 (diff)
downloadgsoc2013-empathy-db6773ebf31853608353b1bb156156879b303569.tar
gsoc2013-empathy-db6773ebf31853608353b1bb156156879b303569.tar.gz
gsoc2013-empathy-db6773ebf31853608353b1bb156156879b303569.tar.bz2
gsoc2013-empathy-db6773ebf31853608353b1bb156156879b303569.tar.lz
gsoc2013-empathy-db6773ebf31853608353b1bb156156879b303569.tar.xz
gsoc2013-empathy-db6773ebf31853608353b1bb156156879b303569.tar.zst
gsoc2013-empathy-db6773ebf31853608353b1bb156156879b303569.zip
allow user to search for contacts using their full identifier
Diffstat (limited to 'libempathy-gtk/empathy-ui-utils.c')
-rw-r--r--libempathy-gtk/empathy-ui-utils.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c
index ee73c14c8..cf3228da5 100644
--- a/libempathy-gtk/empathy-ui-utils.c
+++ b/libempathy-gtk/empathy-ui-utils.c
@@ -1949,8 +1949,13 @@ empathy_get_current_action_time (void)
return (tp_user_action_time_from_x11 (gtk_get_current_event_time ()));
}
+/* @words = empathy_live_search_strip_utf8_string (@text);
+ *
+ * User has to pass both so we don't have to compute @words ourself each time
+ * this function is called. */
gboolean
-empathy_individual_match_words (FolksIndividual *individual,
+empathy_individual_match_string (FolksIndividual *individual,
+ const char *text,
GPtrArray *words)
{
const gchar *str;
@@ -1975,6 +1980,12 @@ empathy_individual_match_words (FolksIndividual *individual,
continue;
str = folks_persona_get_display_id (l->data);
+
+ /* Accept the persona if @text is a full prefix of his ID; that allows
+ * user to find, say, a jabber contact by typing his JID. */
+ if (g_str_has_prefix (str, text))
+ return TRUE;
+
p = strstr (str, "@");
if (p != NULL)
str = dup_str = g_strndup (str, p - str);