diff options
author | James Booth <boothj5@gmail.com> | 2013-01-31 01:50:37 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2013-01-31 01:50:37 +0000 |
commit | 8a69fffd86d01222cdb2b69d434ee6e15a6eeda3 (patch) | |
tree | c2c39d8618cf721239f808b0270b0429603fc904 /src/accounts.c | |
parent | 40bcaffa0cf1d819ffd1219df604c4d7b433e55e (diff) | |
download | profani-tty-8a69fffd86d01222cdb2b69d434ee6e15a6eeda3.tar.gz |
Added priority properties to account
Diffstat (limited to 'src/accounts.c')
-rw-r--r-- | src/accounts.c | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/src/accounts.c b/src/accounts.c index d7149b77..8a765b9a 100644 --- a/src/accounts.c +++ b/src/accounts.c @@ -326,6 +326,81 @@ accounts_set_resource(const char * const account_name, const char * const value) } void +accounts_set_priority_online(const char * const account_name, const gint value) +{ + if (accounts_account_exists(account_name)) { + g_key_file_set_integer(accounts, account_name, "priority.online", value); + _save_accounts(); + } +} + +void +accounts_set_priority_chat(const char * const account_name, const gint value) +{ + if (accounts_account_exists(account_name)) { + g_key_file_set_integer(accounts, account_name, "priority.chat", value); + _save_accounts(); + } +} + +void +accounts_set_priority_away(const char * const account_name, const gint value) +{ + if (accounts_account_exists(account_name)) { + g_key_file_set_integer(accounts, account_name, "priority.away", value); + _save_accounts(); + } +} + +void +accounts_set_priority_xa(const char * const account_name, const gint value) +{ + if (accounts_account_exists(account_name)) { + g_key_file_set_integer(accounts, account_name, "priority.xa", value); + _save_accounts(); + } +} + +void +accounts_set_priority_dnd(const char * const account_name, const gint value) +{ + if (accounts_account_exists(account_name)) { + g_key_file_set_integer(accounts, account_name, "priority.dnd", value); + _save_accounts(); + } +} + +gint +prefs_get_priority_online(const char * const account_name) +{ + return g_key_file_get_integer(accounts, account_name, "priority.online", NULL); +} + +gint +prefs_get_priority_chat(const char * const account_name) +{ + return g_key_file_get_integer(accounts, account_name, "priority.chat", NULL); +} + +gint +prefs_get_priority_away(const char * const account_name) +{ + return g_key_file_get_integer(accounts, account_name, "priority.away", NULL); +} + +gint +prefs_get_priority_xa(const char * const account_name) +{ + return g_key_file_get_integer(accounts, account_name, "priority.xa", NULL); +} + +gint +prefs_get_priority_dnd(const char * const account_name) +{ + return g_key_file_get_integer(accounts, account_name, "priority.dnd", NULL); +} + +void accounts_set_last_presence(const char * const account_name, const char * const value) { if (accounts_account_exists(account_name)) { |