#include "filtering.h"
#include "prefs_actions.h"
#include "hooks.h"
+#include "passwordstore.h"
enum {
ACCOUNT_IS_DEFAULT,
GINT_TO_POINTER(ac_prefs->account_id));
}
+ gchar *uid = g_strdup_printf("%d", ac_prefs->account_id);
+ passwd_store_delete_block(PWS_ACCOUNT, uid);
+ g_free(uid);
+
debug_print("Removing filter rules relative to this account...\n");
for(cur = filtering_rules ; cur != NULL ;) {
FilteringProp * prop = (FilteringProp *) cur->data;
return password;
}
+gboolean passwd_store_delete_block(PasswordBlockType block_type,
+ const gchar *block_name)
+{
+ PasswordBlock *block;
+
+ g_return_val_if_fail(block_type >= 0 && block_type < NUM_PWS_TYPES,
+ FALSE);
+ g_return_val_if_fail(block_name != NULL, FALSE);
+
+ debug_print("Deleting block (%d/%s)\n", block_type, block_name);
+
+ // find correct block
+ if ((block = _get_block(block_type, block_name)) == NULL) {
+ debug_print("Block (%d/%s) not found.\n", block_type, block_name);
+ return FALSE;
+ }
+
+ g_hash_table_destroy(block->entries);
+ return TRUE;
+}
+
gboolean passwd_store_set_account(gint account_id,
const gchar *password_id,
const gchar *password,
const gchar *block_name,
const gchar *password_id);
+gboolean passwd_store_delete_block(PasswordBlockType block_type,
+ const gchar *block_name);
+
/* Reencrypts all stored passwords using new_mpwd as an encryption
* password. */
void passwd_store_reencrypt_all(const gchar *old_mpwd,