diff options
author | James Booth <boothj5@gmail.com> | 2013-06-02 03:02:32 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2013-06-02 03:02:32 +0100 |
commit | 1ef0c8c45f040c1d7af3f7289194fec587ad6d15 (patch) | |
tree | cdb45746334a70dcb214c41566ed6433903d16f9 /src/command | |
parent | 9dd5456f8859bace70174f1b2dc6f7828e8b4e68 (diff) | |
download | profani-tty-1ef0c8c45f040c1d7af3f7289194fec587ad6d15.tar.gz |
Added 'any' to /who command
Diffstat (limited to 'src/command')
-rw-r--r-- | src/command/command.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/command/command.c b/src/command/command.c index 41413320..8c281e7c 100644 --- a/src/command/command.c +++ b/src/command/command.c @@ -955,6 +955,7 @@ cmd_init(void) autocomplete_add(who_ac, strdup("offline")); autocomplete_add(who_ac, strdup("available")); autocomplete_add(who_ac, strdup("unavailable")); + autocomplete_add(who_ac, strdup("any")); cmd_history_init(); } @@ -1770,7 +1771,8 @@ _cmd_who(gchar **args, struct cmd_help_t help) && (strcmp(presence, "away") != 0) && (strcmp(presence, "chat") != 0) && (strcmp(presence, "xa") != 0) - && (strcmp(presence, "dnd") != 0)) { + && (strcmp(presence, "dnd") != 0) + && (strcmp(presence, "any") != 0)) { cons_show("Usage: %s", help.usage); // valid arg @@ -1780,7 +1782,7 @@ _cmd_who(gchar **args, struct cmd_help_t help) GList *list = muc_get_roster(room); // no arg, show all contacts - if (presence == NULL) { + if ((presence == NULL) || (g_strcmp0(presence, "any") == 0)) { ui_room_roster(room, list, NULL); // available @@ -1860,7 +1862,7 @@ _cmd_who(gchar **args, struct cmd_help_t help) GSList *list = roster_get_contacts(); // no arg, show all contacts - if (presence == NULL) { + if ((presence == NULL) || (g_strcmp0(presence, "any") == 0)) { cons_show("All contacts:"); cons_show_contacts(list); |