aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-09-15 01:51:34 +0800
committerDan Winship <danw@src.gnome.org>2000-09-15 01:51:34 +0800
commitdc5039bf5f71401879555beb6b61d04c5d809af5 (patch)
treeefc20731c455d4e806e890d49d856fbf2ddbc6c4 /camel/providers
parent5a5baa256e385b0e24e410663c0eefc92890181a (diff)
downloadgsoc2013-evolution-dc5039bf5f71401879555beb6b61d04c5d809af5.tar
gsoc2013-evolution-dc5039bf5f71401879555beb6b61d04c5d809af5.tar.gz
gsoc2013-evolution-dc5039bf5f71401879555beb6b61d04c5d809af5.tar.bz2
gsoc2013-evolution-dc5039bf5f71401879555beb6b61d04c5d809af5.tar.lz
gsoc2013-evolution-dc5039bf5f71401879555beb6b61d04c5d809af5.tar.xz
gsoc2013-evolution-dc5039bf5f71401879555beb6b61d04c5d809af5.tar.zst
gsoc2013-evolution-dc5039bf5f71401879555beb6b61d04c5d809af5.zip
Don't look at the response of the command. camel_imap_command_extended()
* providers/imap/camel-imap-folder.c (imap_expunge): Don't look at the response of the command. camel_imap_command_extended() processes EXPUNGE responses itself, so if we do it here too we remove twice as many summary items as we should. svn path=/trunk/; revision=5432
Diffstat (limited to 'camel/providers')
-rw-r--r--camel/providers/imap/camel-imap-folder.c82
1 files changed, 2 insertions, 80 deletions
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index 643587bbe7..8a6998fa76 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -361,92 +361,14 @@ static void
imap_expunge (CamelFolder *folder, CamelException *ex)
{
CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder);
- gchar *node, *result;
- gint i, status, recent = -1;
-
- g_return_if_fail (folder != NULL);
+ gchar *result;
+ gint status;
imap_sync (folder, FALSE, ex);
status = camel_imap_command_extended (CAMEL_IMAP_STORE (folder->parent_store), folder,
&result, ex, "EXPUNGE");
-
- if (status != CAMEL_IMAP_OK)
- return;
-
- /* determine which messages were successfully expunged */
- node = result;
- for (i = 0; node; i++) {
- char *word;
-
- if (*node != '*')
- break;
-
- word = imap_next_word (node);
-
- if (!strncmp (word, "NO", 2)) {
- /* Something failed, probably a Read-Only mailbox? */
- CamelService *service = CAMEL_SERVICE (folder->parent_store);
- char *reason, *ep;
-
- word = imap_next_word (word);
- for (ep = word; *ep && *ep != '\n'; ep++);
- reason = g_strndup (word, (gint)(ep - word));
-
- camel_exception_setv (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- "Could not EXPUNGE from IMAP server %s: %s.",
- service->url->host, reason ? reason :
- "Unknown error");
-
- g_free (reason);
- break;
- }
-
- /* else we have a message id? */
- if (*word >= '0' && *word <= '9' && !strncmp ("EXPUNGE", imap_next_word (word), 7)) {
- int id;
-
- id = atoi (word);
-
- d(fprintf (stderr, "Expunging message %d from the summary (i = %d)\n", id + i, i));
-
- if (id <= imap_folder->summary->len) {
- CamelMessageInfo *info;
-
- info = (CamelMessageInfo *) imap_folder->summary->pdata[id - 1];
-
- /* remove from the lookup table and summary */
- g_hash_table_remove (imap_folder->summary_hash, info->uid);
- g_ptr_array_remove_index (imap_folder->summary, id - 1);
-
- /* free the info data */
- g_free (info->subject);
- g_free (info->from);
- g_free (info->to);
- g_free (info->cc);
- g_free (info->uid);
- g_free (info->message_id);
- header_references_list_clear (&info->references);
- g_free (info);
- info = NULL;
- } else {
- /* Hopefully this should never happen */
- d(fprintf (stderr, "imap expunge-error: message %d is out of range\n", id));
- }
- } else if (*word >= '0' && *word <= '9' && !strncmp ("RECENT", imap_next_word (word), 6)) {
- recent = atoi (word);
- if (!recent)
- recent = -1;
- }
-
- for ( ; *node && *node != '\n'; node++);
- if (*node)
- node++;
- }
-
g_free (result);
-
- camel_imap_folder_changed (folder, recent, NULL, ex);
}
static gint