diff options
author | Not Zed <NotZed@Ximian.com> | 2004-05-20 10:19:16 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-05-20 10:19:16 +0800 |
commit | bed95fa9e2b1cfa7e019e1824dc9bdb08fb1755a (patch) | |
tree | 4f356cec5263700691d62b06390de2dd63d6023d /camel | |
parent | 9053f8159f165d59d230f670f6615b907d88e789 (diff) | |
download | gsoc2013-evolution-bed95fa9e2b1cfa7e019e1824dc9bdb08fb1755a.tar.gz gsoc2013-evolution-bed95fa9e2b1cfa7e019e1824dc9bdb08fb1755a.tar.zst gsoc2013-evolution-bed95fa9e2b1cfa7e019e1824dc9bdb08fb1755a.zip |
copy the messageinfo rather than reference the source folder's one, we
2004-05-19 Not Zed <NotZed@Ximian.com>
* camel-folder.c (transfer_message_to): copy the messageinfo
rather than reference the source folder's one, we poke its flags
variable if the message is deleted. And dont re-delete the
message if its already deleted.
svn path=/trunk/; revision=26003
Diffstat (limited to 'camel')
-rw-r--r-- | camel/ChangeLog | 5 | ||||
-rw-r--r-- | camel/camel-folder.c | 25 |
2 files changed, 16 insertions, 14 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index d2af643192..56d534f288 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,5 +1,10 @@ 2004-05-19 Not Zed <NotZed@Ximian.com> + * camel-folder.c (transfer_message_to): copy the messageinfo + rather than reference the source folder's one, we poke its flags + variable if the message is deleted. And dont re-delete the + message if its already deleted. + * providers/nntp/camel-nntp-folder.c (nntp_folder_get_message): use the article number instead of the messageid. Some servers are just broken. diff --git a/camel/camel-folder.c b/camel/camel-folder.c index bb81ab88cc..fcb77723af 100644 --- a/camel/camel-folder.c +++ b/camel/camel-folder.c @@ -1364,24 +1364,26 @@ transfer_message_to (CamelFolder *source, const char *uid, CamelFolder *dest, CamelException *ex) { CamelMimeMessage *msg; - CamelMessageInfo *info = NULL; + CamelMessageInfo *minfo, *info; /* Default implementation. */ msg = camel_folder_get_message(source, uid, ex); if (!msg) return; - - if (source->folder_flags & CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY) - info = camel_folder_get_message_info(source, uid); - else + + /* if its deleted we poke the flags, so we need to copy the messageinfo */ + if ((source->folder_flags & CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY) + && (minfo = camel_folder_get_message_info(source, uid))) { + info = camel_message_info_new(); + camel_message_info_dup_to(minfo, info); + camel_folder_free_message_info(source, minfo); + } else info = camel_message_info_new_from_header (((CamelMimePart *)msg)->headers); /* we don't want to retain the deleted flag */ - if (info && info->flags & CAMEL_MESSAGE_DELETED) { + if (info && info->flags & CAMEL_MESSAGE_DELETED) info->flags = info->flags & ~CAMEL_MESSAGE_DELETED; - delete_original = TRUE; - } camel_folder_append_message (dest, msg, info, transferred_uid, ex); camel_object_unref (msg); @@ -1389,12 +1391,7 @@ transfer_message_to (CamelFolder *source, const char *uid, CamelFolder *dest, if (delete_original && !camel_exception_is_set (ex)) camel_folder_set_message_flags (source, uid, CAMEL_MESSAGE_DELETED|CAMEL_MESSAGE_SEEN, ~0); - if (info) { - if (source->folder_flags & CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY) - camel_folder_free_message_info(source, info); - else - camel_message_info_free (info); - } + camel_message_info_free (info); } static void |