Added /account list command, and added jid property to accounts

This commit is contained in:
James Booth
2012-12-09 20:18:38 +00:00
parent 0bba09fd04
commit 324a85a2a5
3 changed files with 64 additions and 0 deletions

View File

@@ -84,14 +84,28 @@ accounts_reset_login_search(void)
void
accounts_add_login(const char *jid, const char *altdomain)
{
// doesn't yet exist
if (!g_key_file_has_group(accounts, jid)) {
g_key_file_set_boolean(accounts, jid, "enabled", TRUE);
g_key_file_set_string(accounts, jid, "jid", jid);
if (altdomain != NULL) {
g_key_file_set_string(accounts, jid, "server", altdomain);
}
_save_accounts();
// already exists, update old style accounts
} else {
g_key_file_set_string(accounts, jid, "jid", jid);
_save_accounts();
}
}
gchar**
accounts_get_list(void)
{
return g_key_file_get_groups(accounts, NULL);
}
static void