mirror of
https://github.com/profanity-im/profanity.git
synced 2024-11-03 19:37:16 -05:00
Implemented /group command with no args (list groups)
This commit is contained in:
parent
b89a751903
commit
6082ab8778
@ -2136,7 +2136,19 @@ _cmd_group(gchar **args, struct cmd_help_t help)
|
|||||||
|
|
||||||
// list all groups
|
// list all groups
|
||||||
if (args[0] == NULL) {
|
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;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -378,6 +378,12 @@ roster_get_contacts(void)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GSList *
|
||||||
|
roster_get_groups(void)
|
||||||
|
{
|
||||||
|
return autocomplete_get_list(groups_ac);
|
||||||
|
}
|
||||||
|
|
||||||
GSList *
|
GSList *
|
||||||
roster_get_group(const char * const group)
|
roster_get_group(const char * const group)
|
||||||
{
|
{
|
||||||
|
@ -151,5 +151,6 @@ GSList * roster_get_group(const char * const group);
|
|||||||
void roster_add_to_group(const char * const group, const char * const barejid);
|
void roster_add_to_group(const char * const group, const char * const barejid);
|
||||||
void roster_remove_from_group(const char * const group,
|
void roster_remove_from_group(const char * const group,
|
||||||
const char * const barejid);
|
const char * const barejid);
|
||||||
|
GSList * roster_get_groups(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user