diff options
author | James Booth <boothj5@gmail.com> | 2012-12-10 00:23:55 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2012-12-10 00:23:55 +0000 |
commit | 8415f57b3293742547f07323fbefdd278bdcb24d (patch) | |
tree | e7e942944d4d78f20f31e399fa3aff28c5cbc5f5 /src/accounts.c | |
parent | c80383e298287372b5bf5d852c7ff5759cf20b15 (diff) | |
download | profani-tty-8415f57b3293742547f07323fbefdd278bdcb24d.tar.gz |
Added /account set command, set server or jid
Diffstat (limited to 'src/accounts.c')
-rw-r--r-- | src/accounts.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/accounts.c b/src/accounts.c index 22fe8693..7729cfb4 100644 --- a/src/accounts.c +++ b/src/accounts.c @@ -218,6 +218,31 @@ accounts_rename(const char * const account_name, const char * const new_name) return TRUE; } +gboolean +accounts_account_exists(const char * const account_name) +{ + return g_key_file_has_group(accounts, account_name); + +} + +void +accounts_set_jid(const char * const account_name, const char * const value) +{ + if (accounts_account_exists(account_name)) { + g_key_file_set_string(accounts, account_name, "jid", value); + _save_accounts(); + } +} + +void +accounts_set_server(const char * const account_name, const char * const value) +{ + if (accounts_account_exists(account_name)) { + g_key_file_set_string(accounts, account_name, "server", value); + _save_accounts(); + } +} + static void _save_accounts(void) { |