mcabber/src/commands.c
changeset 265 49e9e02dd6d0
parent 262 ab6f83a82811
child 277 4d7040cff8ee
--- a/mcabber/src/commands.c	Sat Jul 02 12:06:10 2005 +0100
+++ b/mcabber/src/commands.c	Sat Jul 02 19:23:45 2005 +0100
@@ -104,9 +104,10 @@
 
   // Roster category
   compl_add_category_word(COMPL_ROSTER, "bottom");
+  compl_add_category_word(COMPL_ROSTER, "top");
   compl_add_category_word(COMPL_ROSTER, "hide_offline");
   compl_add_category_word(COMPL_ROSTER, "show_offline");
-  compl_add_category_word(COMPL_ROSTER, "top");
+  compl_add_category_word(COMPL_ROSTER, "search");
   compl_add_category_word(COMPL_ROSTER, "unread_first");
   compl_add_category_word(COMPL_ROSTER, "unread_next");
 
@@ -276,6 +277,20 @@
     scr_RosterUnreadMessage(0);
   } else if (!strcasecmp(arg, "unread_next")) {
     scr_RosterUnreadMessage(1);
+  } else if (!strncasecmp(arg, "search", 6)) {
+    char *string = arg+6;
+    if (*string && (*string != ' ')) {
+      scr_LogPrint("Unrecognized parameter!");
+      return;
+    }
+    while (*string == ' ')
+      string++;
+    if (!*string) {
+      scr_LogPrint("What name or jid are you looking for?");
+      return;
+    }
+    scr_RosterSearch(string);
+    update_roster = TRUE;
   } else
     scr_LogPrint("Unrecognized parameter!");
 }