Added /roster empty command

This commit is contained in:
James Booth
2015-06-20 00:38:28 +01:00
parent e117c0368f
commit d7ec339e3e
2 changed files with 19 additions and 0 deletions

View File

@@ -1640,6 +1640,23 @@ cmd_roster(ProfWin *window, gchar **args, struct cmd_help_t help)
}
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
} else if (strcmp(args[0], "nick") == 0) {
if (conn_status != JABBER_CONNECTED) {