Use account ID instead of name in passwordstorerc.
[claws.git] / src / passwordstore.c
index 8e3942a314f37303b47a676b597503dbc3236c81..a518b7c20baeb00ee3ac09757981e10a5fd51be9 100644 (file)
@@ -197,6 +197,27 @@ gchar *passwd_store_get(PasswordBlockType block_type,
        return password;
 }
 
+gboolean passwd_store_set_account(gint account_id,
+               const gchar *password_id,
+               const gchar *password,
+               gboolean encrypted)
+{
+       gchar *uid = g_strdup_printf("%d", account_id);
+       gboolean ret = passwd_store_set(PWS_ACCOUNT, uid,
+                       password_id, password, encrypted);
+       g_free(uid);
+       return ret;
+}
+
+gchar *passwd_store_get_account(gint account_id,
+               const gchar *password_id)
+{
+       gchar *uid = g_strdup_printf("%d", account_id);
+       gchar *ret = passwd_store_get(PWS_ACCOUNT, uid, password_id);
+       g_free(uid);
+       return ret;
+}
+
 /* Reencrypts all stored passwords. */
 void passwd_store_reencrypt_all(const gchar *old_mpwd,
                const gchar *new_mpwd)