aboutsummaryrefslogtreecommitdiffstats
path: root/storage.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-09-01 01:18:21 +0200
committerWilmer van der Gaast <wilmer@gaast.net>2010-09-01 01:18:21 +0200
commit0c85c08d210e16bb10dc283b4a1478ce53c0c1b1 (patch)
tree4d7fb00a0467ba51337fdc84cacade43b6baab97 /storage.c
parentf5c0d8e4dd3ce01945a6334a5d87c89a9f43b16b (diff)
Pluginify this thing a little bit. Not so much in the dynamically loadable
sense of the word, more in a way that core files don't have to include otr.h.
Diffstat (limited to 'storage.c')
-rw-r--r--storage.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/storage.c b/storage.c
index 0c534858..ad1833fc 100644
--- a/storage.c
+++ b/storage.c
@@ -27,7 +27,6 @@
#define BITLBEE_CORE
#include "bitlbee.h"
-#include "otr.h"
extern storage_t storage_text;
extern storage_t storage_xml;
@@ -114,10 +113,9 @@ storage_status_t storage_load (irc_t * irc, const char *password)
storage_status_t status;
status = st->load(irc, password);
- if (status == STORAGE_OK) {
- otr_load(irc);
+ if (status == STORAGE_OK)
return status;
- }
+
if (status != STORAGE_NO_SUCH_USER)
return status;
}
@@ -138,8 +136,7 @@ storage_status_t storage_save (irc_t *irc, char *password, int overwrite)
} else if ((irc->status & USTATUS_IDENTIFIED) == 0) {
return STORAGE_NO_SUCH_USER;
}
-
- otr_save(irc);
+
st = ((storage_t *)global.storage->data)->save(irc, overwrite);
if (password != NULL) {
@@ -165,9 +162,6 @@ storage_status_t storage_remove (const char *nick, const char *password)
if (status != STORAGE_NO_SUCH_USER && status != STORAGE_OK)
ret = status;
}
- if (ret == STORAGE_OK) {
- otr_remove(nick);
- }
return ret;
}
@@ -181,14 +175,12 @@ storage_status_t storage_rename (const char *onick, const char *nnick, const cha
GList *gl = global.storage;
storage_t *primary_storage = gl->data;
irc_t *irc;
-
+
/* First, try to rename in the current write backend, assuming onick
* is stored there */
status = primary_storage->rename(onick, nnick, password);
- if (status != STORAGE_NO_SUCH_USER) {
- otr_rename(onick, nnick);
+ if (status != STORAGE_NO_SUCH_USER)
return status;
- }
/* Try to load from a migration backend and save to the current backend.
* Explicitly remove the account from the migration backend as otherwise
@@ -212,7 +204,6 @@ storage_status_t storage_rename (const char *onick, const char *nnick, const cha
irc_free(irc);
storage_remove(onick, password);
- otr_rename(onick, nnick);
return STORAGE_OK;
}