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

@@ -167,7 +167,7 @@ account_new(const gchar *const name, const gchar *const jid,
}
char*
account_create_full_jid(ProfAccount *account)
account_create_connect_jid(ProfAccount *account)
{
if (account->resource) {
return create_fulljid(account->jid, account->resource);

View File

@@ -74,7 +74,7 @@ ProfAccount* account_new(const gchar *const name, const gchar *const jid,
const gchar *const otr_policy, GList *otr_manual, GList *otr_opportunistic,
GList *otr_always, const gchar *const pgp_keyid, const char *const startscript,
const char *const theme, gchar *tls_policy);
char* account_create_full_jid(ProfAccount *account);
char* account_create_connect_jid(ProfAccount *account);
gboolean account_eval_password(ProfAccount *account);
void account_free(ProfAccount *account);

View File

@@ -584,6 +584,15 @@ accounts_clear_muc(const char *const account_name)
}
}
void
accounts_clear_resource(const char *const account_name)
{
if (accounts_account_exists(account_name)) {
g_key_file_remove_key(accounts, account_name, "resource", NULL);
_save_accounts();
}
}
void
accounts_clear_otr(const char *const account_name)
{

View File

@@ -94,6 +94,7 @@ void accounts_clear_pgp_keyid(const char *const account_name);
void accounts_clear_script_start(const char *const account_name);
void accounts_clear_theme(const char *const account_name);
void accounts_clear_muc(const char *const account_name);
void accounts_clear_resource(const char *const account_name);
void accounts_add_otr_policy(const char *const account_name, const char *const contact_jid, const char *const policy);
#endif