1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-23 21:45:30 +00:00

Added priority properties to account

This commit is contained in:
James Booth 2013-01-31 01:50:37 +00:00
parent 40bcaffa0c
commit 8a69fffd86
2 changed files with 85 additions and 0 deletions

View File

@ -325,6 +325,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)
{

View File

@ -63,5 +63,15 @@ void accounts_set_last_presence(const char * const account_name, const char * co
void accounts_set_login_presence(const char * const account_name, const char * const value);
jabber_presence_t accounts_get_login_presence(const char * const account_name);
jabber_presence_t accounts_get_last_presence(const char * const account_name);
void accounts_set_priority_online(const char * const account_name, const gint value);
void accounts_set_priority_chat(const char * const account_name, const gint value);
void accounts_set_priority_away(const char * const account_name, const gint value);
void accounts_set_priority_xa(const char * const account_name, const gint value);
void accounts_set_priority_dnd(const char * const account_name, const gint value);
gint prefs_get_priority_online(const char * const account_name);
gint prefs_get_priority_chat(const char * const account_name);
gint prefs_get_priority_away(const char * const account_name);
gint prefs_get_priority_xa(const char * const account_name);
gint prefs_get_priority_dnd(const char * const account_name);
#endif