mirror of
https://github.com/profanity-im/profanity.git
synced 2025-07-05 17:28:00 -04:00
Added missing account properties to /account rename
This commit is contained in:
parent
16103f6cc7
commit
0b03f72b2c
@ -53,21 +53,6 @@ static GKeyFile *accounts;
|
|||||||
static Autocomplete all_ac;
|
static Autocomplete all_ac;
|
||||||
static Autocomplete enabled_ac;
|
static Autocomplete enabled_ac;
|
||||||
|
|
||||||
// used to rename account (copies properties to new account)
|
|
||||||
static gchar *string_keys[] = {
|
|
||||||
"jid",
|
|
||||||
"server",
|
|
||||||
"port",
|
|
||||||
"resource",
|
|
||||||
"password",
|
|
||||||
"eval_password",
|
|
||||||
"presence.last",
|
|
||||||
"presence.login",
|
|
||||||
"muc.service",
|
|
||||||
"muc.nick",
|
|
||||||
"otr.policy"
|
|
||||||
};
|
|
||||||
|
|
||||||
static void _save_accounts(void);
|
static void _save_accounts(void);
|
||||||
static gchar * _get_accounts_file(void);
|
static gchar * _get_accounts_file(void);
|
||||||
static void _remove_from_list(GKeyFile *accounts, const char * const account_name, const char * const key, const char * const contact_jid);
|
static void _remove_from_list(GKeyFile *accounts, const char * const account_name, const char * const key, const char * const contact_jid);
|
||||||
@ -338,21 +323,33 @@ accounts_rename(const char * const account_name, const char * const new_name)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_key_file_set_boolean(accounts, new_name, "enabled",
|
// treat all properties as strings for copy
|
||||||
g_key_file_get_boolean(accounts, account_name, "enabled", NULL));
|
gchar *string_keys[] = {
|
||||||
|
"enabled",
|
||||||
|
"jid",
|
||||||
|
"server",
|
||||||
|
"port",
|
||||||
|
"resource",
|
||||||
|
"password",
|
||||||
|
"eval_password",
|
||||||
|
"presence.last",
|
||||||
|
"presence.laststatus",
|
||||||
|
"presence.login",
|
||||||
|
"priority.online",
|
||||||
|
"priority.chat",
|
||||||
|
"priority.away",
|
||||||
|
"priority.xa",
|
||||||
|
"priority.dnd",
|
||||||
|
"muc.service",
|
||||||
|
"muc.nick",
|
||||||
|
"otr.policy",
|
||||||
|
"otr.manual",
|
||||||
|
"otr.opportunistic",
|
||||||
|
"otr.always",
|
||||||
|
"pgp.keyid",
|
||||||
|
"last.activity"
|
||||||
|
};
|
||||||
|
|
||||||
g_key_file_set_integer(accounts, new_name, "priority.online",
|
|
||||||
g_key_file_get_integer(accounts, account_name, "priority.online", NULL));
|
|
||||||
g_key_file_set_integer(accounts, new_name, "priority.chat",
|
|
||||||
g_key_file_get_integer(accounts, account_name, "priority.chat", NULL));
|
|
||||||
g_key_file_set_integer(accounts, new_name, "priority.away",
|
|
||||||
g_key_file_get_integer(accounts, account_name, "priority.away", NULL));
|
|
||||||
g_key_file_set_integer(accounts, new_name, "priority.xa",
|
|
||||||
g_key_file_get_integer(accounts, account_name, "priority.xa", NULL));
|
|
||||||
g_key_file_set_integer(accounts, new_name, "priority.dnd",
|
|
||||||
g_key_file_get_integer(accounts, account_name, "priority.dnd", NULL));
|
|
||||||
|
|
||||||
// copy other string properties
|
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < ARRAY_SIZE(string_keys); i++) {
|
for (i = 0; i < ARRAY_SIZE(string_keys); i++) {
|
||||||
char *value = g_key_file_get_string(accounts, account_name, string_keys[i], NULL);
|
char *value = g_key_file_get_string(accounts, account_name, string_keys[i], NULL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user