diff options
author | James Booth <boothj5@gmail.com> | 2013-06-02 20:20:44 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2013-06-02 20:20:44 +0100 |
commit | 6082ab8778fb3147081a3b4a9a0c929069a69b73 (patch) | |
tree | 027605f5adc8dfe103c8f0739572c287d46c5754 /src/command | |
parent | b89a7519033a63015639524cfdde1add7b753553 (diff) | |
download | profani-tty-6082ab8778fb3147081a3b4a9a0c929069a69b73.tar.gz |
Implemented /group command with no args (list groups)
Diffstat (limited to 'src/command')
-rw-r--r-- | src/command/command.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/command/command.c b/src/command/command.c index 261afb39..e95e3dc0 100644 --- a/src/command/command.c +++ b/src/command/command.c @@ -2136,7 +2136,19 @@ _cmd_group(gchar **args, struct cmd_help_t help) // list all groups if (args[0] == NULL) { - cons_show("LIST GROUPS"); + GSList *groups = roster_get_groups(); + GSList *curr = groups; + if (curr != NULL) { + cons_show("Groups:"); + while (curr != NULL) { + cons_show(" %s", curr->data); + curr = g_slist_next(curr); + } + + g_slist_free_full(groups, g_free); + } else { + cons_show("No groups."); + } return TRUE; } |