diff options
author | James Booth <boothj5@gmail.com> | 2013-01-31 02:02:16 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2013-01-31 02:02:16 +0000 |
commit | b48d0e90c6d4610d42690dce76f08b75dba03c7a (patch) | |
tree | 750085e966e02a714efc4aa32a51a4f2ee83fba9 | |
parent | 4886577302d393a9b354cedf3b5fdc0a210127c8 (diff) | |
download | profani-tty-b48d0e90c6d4610d42690dce76f08b75dba03c7a.tar.gz |
Deal with account priority properties on add and rename account
-rw-r--r-- | src/accounts.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/accounts.c b/src/accounts.c index 662ef254..78b9ab5b 100644 --- a/src/accounts.c +++ b/src/accounts.c @@ -133,6 +133,11 @@ accounts_add(const char *account_name, const char *altdomain) } g_key_file_set_string(accounts, account_name, "presence.last", "online"); g_key_file_set_string(accounts, account_name, "presence.login", "online"); + g_key_file_set_integer(accounts, account_name, "priority.online", 0); + g_key_file_set_integer(accounts, account_name, "priority.chat", 0); + g_key_file_set_integer(accounts, account_name, "priority.away", 0); + g_key_file_set_integer(accounts, account_name, "priority.xa", 0); + g_key_file_set_integer(accounts, account_name, "priority.dnd", 0); _save_accounts(); autocomplete_add(all_ac, strdup(account_name)); @@ -258,6 +263,17 @@ accounts_rename(const char * const account_name, const char * const new_name) g_key_file_set_boolean(accounts, new_name, "enabled", g_key_file_get_boolean(accounts, account_name, "enabled", NULL)); + g_key_file_set_integer(accounts, new_name, "priority.online", + g_key_file_get_boolean(accounts, account_name, "priority.online", NULL)); + g_key_file_set_integer(accounts, new_name, "priority.chat", + g_key_file_get_boolean(accounts, account_name, "priority.chat", NULL)); + g_key_file_set_integer(accounts, new_name, "priority.away", + g_key_file_get_boolean(accounts, account_name, "priority.away", NULL)); + g_key_file_set_integer(accounts, new_name, "priority.xa", + g_key_file_get_boolean(accounts, account_name, "priority.xa", NULL)); + g_key_file_set_integer(accounts, new_name, "priority.dnd", + g_key_file_get_boolean(accounts, account_name, "priority.dnd", NULL)); + int i; for (i = 0; i < ARRAY_SIZE(string_keys); i++) { char *value = g_key_file_get_string(accounts, account_name, string_keys[i], NULL); |