1
1
mirror of https://github.com/profanity-im/profanity.git synced 2025-01-03 14:57:42 -05:00

Added /account set <account> password <password>

This commit is contained in:
James Booth 2013-11-07 23:36:04 +00:00
parent f0947ccce7
commit 74d400bf94
3 changed files with 15 additions and 0 deletions

View File

@ -738,6 +738,7 @@ static struct cmd_t command_defs[] =
"online|chat|away",
"|xa|dnd : Priority for the specified presence.",
"resource : The resource to be used.",
"password : Password for the account, note this is currently stored in plaintext if set.",
"muc : The default MUC chat service to use.",
"nick : The default nickname to use when joining chat rooms.",
"",
@ -1481,6 +1482,10 @@ _cmd_account(gchar **args, struct cmd_help_t help)
accounts_set_resource(account_name, value);
cons_show("Updated resource for account %s: %s", account_name, value);
cons_show("");
} else if (strcmp(property, "password") == 0) {
accounts_set_password(account_name, value);
cons_show("Updated password for account %s", account_name);
cons_show("");
} else if (strcmp(property, "muc") == 0) {
accounts_set_muc_service(account_name, value);
cons_show("Updated muc service for account %s: %s", account_name, value);

View File

@ -426,6 +426,15 @@ accounts_set_resource(const char * const account_name, const char * const value)
}
}
void
accounts_set_password(const char * const account_name, const char * const value)
{
if (accounts_account_exists(account_name)) {
g_key_file_set_string(accounts, account_name, "password", value);
_save_accounts();
}
}
void
accounts_set_muc_service(const char * const account_name, const char * const value)
{

View File

@ -65,6 +65,7 @@ gboolean accounts_account_exists(const char * const account_name);
void accounts_set_jid(const char * const account_name, const char * const value);
void accounts_set_server(const char * const account_name, const char * const value);
void accounts_set_resource(const char * const account_name, const char * const value);
void accounts_set_password(const char * const account_name, const char * const value);
void accounts_set_muc_service(const char * const account_name, const char * const value);
void accounts_set_muc_nick(const char * const account_name, const char * const value);
void accounts_set_last_presence(const char * const account_name, const char * const value);