diff options
author | Paul J Stevens <paul@nfg.nl> | 2010-06-05 20:52:40 +0200 |
---|---|---|
committer | Paul J Stevens <paul@nfg.nl> | 2010-06-05 20:52:40 +0200 |
commit | 385e20b40a38a96a53720f9043743bfa7d214f29 (patch) | |
tree | cb37dd380b7628a502f235384f2dc1e9f73dfaee | |
parent | b7f97cb4d16efe376ab09598908555abb2278c27 (diff) |
wip mailbox sync
-rw-r--r-- | src/dbmail-imapsession.c | 7 | ||||
-rw-r--r-- | src/dm_mailboxstate.c | 7 | ||||
-rw-r--r-- | src/dm_mailboxstate.h | 2 |
3 files changed, 4 insertions, 12 deletions
diff --git a/src/dbmail-imapsession.c b/src/dbmail-imapsession.c index 05f645ff..1edf53a0 100644 --- a/src/dbmail-imapsession.c +++ b/src/dbmail-imapsession.c @@ -1338,13 +1338,12 @@ static gboolean notify_expunge(ImapSession *self, u64_t *uid) static void mailbox_notify_expunge(ImapSession *self, MailboxState_T N) { - u64_t *uid, *msn, exists; + u64_t *uid, *msn; MailboxState_T M; GList *ids; if (! N) return; M = self->mailbox->mbstate; - exists = MailboxState_getExists(M); ids = g_tree_keys(MailboxState_getIds(M)); ids = g_list_reverse(ids); @@ -1364,7 +1363,6 @@ static void mailbox_notify_expunge(ImapSession *self, MailboxState_T N) uid = (u64_t *)ids->data; if (! g_tree_lookup(MailboxState_getIds(N), uid)) { notify_expunge(self, uid); - exists--; } if (! g_list_next(ids)) break; @@ -1372,9 +1370,6 @@ static void mailbox_notify_expunge(ImapSession *self, MailboxState_T N) } ids = g_list_first(ids); g_list_free(ids); - - // override - MailboxState_setExists(N, exists); } static void mailbox_notify_update(ImapSession *self, MailboxState_T N) diff --git a/src/dm_mailboxstate.c b/src/dm_mailboxstate.c index 75b1e8c6..b49500cc 100644 --- a/src/dm_mailboxstate.c +++ b/src/dm_mailboxstate.c @@ -259,6 +259,8 @@ int MailboxState_removeUid(T M, u64_t uid) { if (! g_tree_remove(M->msginfo, &uid)) { TRACE(TRACE_WARNING,"trying to remove unknown UID [%llu]", uid); + } else { + M->exists--; } MailboxState_remap(M); @@ -290,11 +292,6 @@ u64_t MailboxState_getSeq(T M) return M->seq; } -void MailboxState_setExists(T M, u64_t exists) -{ - M->exists = exists; -} - unsigned MailboxState_getExists(T M) { int real = g_tree_nnodes(M->msginfo); diff --git a/src/dm_mailboxstate.h b/src/dm_mailboxstate.h index d059c914..c108f05c 100644 --- a/src/dm_mailboxstate.h +++ b/src/dm_mailboxstate.h @@ -44,7 +44,6 @@ extern void MailboxState_setId(T, u64_t); extern u64_t MailboxState_getId(T); extern u64_t MailboxState_getSeq(T); extern u64_t MailboxState_getUidnext(T); -extern void MailboxState_setExists(T, u64_t); extern unsigned MailboxState_getExists(T); extern void MailboxState_setRecent(T, u64_t); extern unsigned MailboxState_getRecent(T); @@ -66,6 +65,7 @@ extern void MailboxState_setIsUsers(T, gboolean); extern gboolean MailboxState_isUsers(T); extern void MailboxState_setIsPublic(T, gboolean); extern gboolean MailboxState_isPublic(T); + extern gboolean MailboxState_hasKeyword(T, const char *); extern void MailboxState_addKeyword(T, const char *); |