Added /roster remove command

This commit is contained in:
James Booth
2013-06-02 00:06:05 +01:00
parent 518b6721ff
commit 01bdc6ae5a
5 changed files with 56 additions and 0 deletions

View File

@@ -918,7 +918,9 @@ cmd_init(void)
autocomplete_add(wins_ac, strdup("tidy"));
roster_ac = autocomplete_new();
autocomplete_add(roster_ac, strdup("add"));
autocomplete_add(roster_ac, strdup("nick"));
autocomplete_add(roster_ac, strdup("remove"));
theme_load_ac = NULL;
@@ -2038,6 +2040,21 @@ _cmd_roster(gchar **args, struct cmd_help_t help)
return TRUE;
}
// remove contact
if (strcmp(args[0], "remove") == 0) {
if (args[1] == NULL) {
cons_show("Usage: %s", help.usage);
return TRUE;
}
char *jid = args[1];
roster_remove(jid);
return TRUE;
}
// change nickname
if (strcmp(args[0], "nick") == 0) {