about summary refs log tree commit diff stats
path: root/src/accounts.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/accounts.c')
-rw-r--r--src/accounts.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/accounts.c b/src/accounts.c
index 905904d3..7a84397b 100644
--- a/src/accounts.c
+++ b/src/accounts.c
@@ -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