diff options
author | Paul J Stevens <paul@nfg.nl> | 2010-06-07 12:00:28 +0200 |
---|---|---|
committer | Paul J Stevens <paul@nfg.nl> | 2010-06-07 12:00:28 +0200 |
commit | ae75a3d215405e9b360d8b4da4b751685e2c7e5a (patch) | |
tree | 960457cfe0cd4f2107203be5dab64a54f72e9a8a | |
parent | c2e3a7a2bec3f8245bb7201e8b76549c329e9d4b (diff) |
wip mailbox sync
-rw-r--r-- | src/dbmail-imapsession.c | 9 | ||||
-rw-r--r-- | src/dm_mailboxstate.c | 5 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/dbmail-imapsession.c b/src/dbmail-imapsession.c index 1edf53a0..d7b49652 100644 --- a/src/dbmail-imapsession.c +++ b/src/dbmail-imapsession.c @@ -1315,7 +1315,7 @@ static void notify_fetch(ImapSession *self, MailboxState_T N, u64_t *uid) static gboolean notify_expunge(ImapSession *self, u64_t *uid) { - u64_t * msn; + u64_t *msn = NULL, m = 0; if (! (msn = g_tree_lookup(MailboxState_getIds(self->mailbox->mbstate), uid))) { TRACE(TRACE_DEBUG,"[%p] can't find uid [%llu]", self, *uid); @@ -1328,8 +1328,11 @@ static gboolean notify_expunge(ImapSession *self, u64_t *uid) case IMAP_COMM_SEARCH: break; default: - dbmail_imap_session_buff_printf(self, "* %llu EXPUNGE\r\n", *msn); - MailboxState_removeUid(self->mailbox->mbstate, *uid); + m = *msn; + if (MailboxState_removeUid(self->mailbox->mbstate, *uid) == DM_SUCCESS) + dbmail_imap_session_buff_printf(self, "* %llu EXPUNGE\r\n", m); + else + return TRUE; break; } diff --git a/src/dm_mailboxstate.c b/src/dm_mailboxstate.c index b49500cc..a0705983 100644 --- a/src/dm_mailboxstate.c +++ b/src/dm_mailboxstate.c @@ -259,10 +259,11 @@ 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--; + return DM_EGENERAL; } + M->exists--; + MailboxState_remap(M); return DM_SUCCESS; |