mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-29 16:46:21 +00:00
Added /roster empty command
This commit is contained in:
@@ -204,6 +204,7 @@ static struct cmd_t command_defs[] =
|
|||||||
"size : Percentage of the screen taken up by the roster (1-99).",
|
"size : Percentage of the screen taken up by the roster (1-99).",
|
||||||
"add jid [nick] : Add a new item to the roster.",
|
"add jid [nick] : Add a new item to the roster.",
|
||||||
"remove jid : Removes an item from the roster.",
|
"remove jid : Removes an item from the roster.",
|
||||||
|
"empty : Remove all items from roster."
|
||||||
"nick jid nick : Change a contacts nickname.",
|
"nick jid nick : Change a contacts nickname.",
|
||||||
"clearnick jid : Removes the current nickname.",
|
"clearnick jid : Removes the current nickname.",
|
||||||
"",
|
"",
|
||||||
@@ -1396,6 +1397,7 @@ cmd_init(void)
|
|||||||
autocomplete_add(roster_ac, "nick");
|
autocomplete_add(roster_ac, "nick");
|
||||||
autocomplete_add(roster_ac, "clearnick");
|
autocomplete_add(roster_ac, "clearnick");
|
||||||
autocomplete_add(roster_ac, "remove");
|
autocomplete_add(roster_ac, "remove");
|
||||||
|
autocomplete_add(roster_ac, "empty");
|
||||||
autocomplete_add(roster_ac, "show");
|
autocomplete_add(roster_ac, "show");
|
||||||
autocomplete_add(roster_ac, "hide");
|
autocomplete_add(roster_ac, "hide");
|
||||||
autocomplete_add(roster_ac, "by");
|
autocomplete_add(roster_ac, "by");
|
||||||
|
|||||||
@@ -1640,6 +1640,23 @@ cmd_roster(ProfWin *window, gchar **args, struct cmd_help_t help)
|
|||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
} else if (strcmp(args[0], "empty") == 0) {
|
||||||
|
if (conn_status != JABBER_CONNECTED) {
|
||||||
|
cons_show("You are not currently connected.");
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
GSList *all = roster_get_contacts();
|
||||||
|
GSList *curr = all;
|
||||||
|
while (curr) {
|
||||||
|
PContact contact = curr->data;
|
||||||
|
roster_send_remove(p_contact_barejid(contact));
|
||||||
|
curr = g_slist_next(curr);
|
||||||
|
}
|
||||||
|
|
||||||
|
g_slist_free(all);
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
// change nickname
|
// change nickname
|
||||||
} else if (strcmp(args[0], "nick") == 0) {
|
} else if (strcmp(args[0], "nick") == 0) {
|
||||||
if (conn_status != JABBER_CONNECTED) {
|
if (conn_status != JABBER_CONNECTED) {
|
||||||
|
|||||||
Reference in New Issue
Block a user