Allow clearing account resource

issue #880
This commit is contained in:
James Booth
2016-11-22 00:39:52 +00:00
parent c441dbfa42
commit e043029a50
17 changed files with 75 additions and 40 deletions

View File

@@ -361,6 +361,7 @@ cmd_ac_init(void)
autocomplete_add(account_clear_ac, "startscript");
autocomplete_add(account_clear_ac, "theme");
autocomplete_add(account_clear_ac, "muc");
autocomplete_add(account_clear_ac, "resource");
account_default_ac = autocomplete_new();
autocomplete_add(account_default_ac, "set");

View File

@@ -1990,7 +1990,8 @@ static struct cmd_t command_defs[] =
"/account clear <account> otr",
"/account clear <account> pgpkeyid",
"/account clear <account> startscript",
"/account clear <account> muc")
"/account clear <account> muc",
"/account clear <account> resource")
CMD_DESC(
"Commands for creating and managing accounts. "
"Calling with no arguments will display information for the current account.")
@@ -2030,6 +2031,7 @@ static struct cmd_t command_defs[] =
{ "clear <account> pgpkeyid", "Remove pgpkeyid associated with this account." },
{ "clear <account> startscript", "Remove startscript associated with this account." },
{ "clear <account> theme", "Clear the theme setting for the account, the global theme will be used." },
{ "clear <account> resource", "Remove the resource setting for this account."},
{ "clear <account> muc", "Remove the default MUC service setting."})
CMD_EXAMPLES(
"/account add me",

View File

@@ -416,7 +416,7 @@ cmd_connect(ProfWin *window, const char *const command, gchar **args)
account->password = NULL;
}
jid = account_create_full_jid(account);
jid = account_create_connect_jid(account);
account_free(account);
// connect with JID
@@ -963,6 +963,10 @@ cmd_account_clear(ProfWin *window, const char *const command, gchar **args)
accounts_clear_muc(account_name);
cons_show("Removed MUC service for account %s", account_name);
cons_show("");
} else if (strcmp(property, "resource") == 0) {
accounts_clear_resource(account_name);
cons_show("Removed resource for account %s", account_name);
cons_show("");
} else {
cons_show("Invalid property: %s", property);
cons_show("");