aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--camel/camel-folder.c18
-rw-r--r--camel/camel-folder.h3
-rw-r--r--camel/providers/MH/camel-mh-folder.c17
4 files changed, 38 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 218efecd06..aeceeb1ea3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@
moved the active list readjustment code here.
Much saner, providers won't have to worry about
that.
+ (_copy_message_to): new method.
* camel/providers/MH/camel-mh-folder.c (_expunge):
no more active list readjustment stuff.
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index d701345dad..ba8fd98ea2 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -54,6 +54,7 @@ static CamelMimeMessage *_get_message (CamelFolder *folder, gint number);
static gint _get_message_count (CamelFolder *folder);
static gint _append_message (CamelFolder *folder, CamelMimeMessage *message);
static const GList *_list_permanent_flags (CamelFolder *folder);
+static void _copy_message_to (CamelFolder *folder, CamelMimeMessage *message, CamelFolder *dest_folder);
static void _finalize (GtkObject *object);
@@ -88,6 +89,7 @@ camel_folder_class_init (CamelFolderClass *camel_folder_class)
camel_folder_class->get_message_count = _get_message_count;
camel_folder_class->append_message = _append_message;
camel_folder_class->list_permanent_flags = _list_permanent_flags;
+ camel_folder_class->copy_message_to;
/* virtual method overload */
gtk_object_class->finalize = _finalize;
@@ -940,3 +942,19 @@ camel_folder_list_permanent_flags (CamelFolder *folder)
{
return CF_CLASS (folder)->list_permanent_flags (folder);
}
+
+
+
+
+static void
+_copy_message_to (CamelFolder *folder, CamelMimeMessage *message, CamelFolder *dest_folder)
+{
+ camel_folder_append_message (dest_folder, message);
+}
+
+
+void
+camel_folder_copy_message_to (CamelFolder *folder, CamelMimeMessage *message, CamelFolder *dest_folder)
+{
+ CF_CLASS (folder)->copy_message_to (folder, message, dest_folder);;
+}
diff --git a/camel/camel-folder.h b/camel/camel-folder.h
index 4ec63a65f7..add74fb0af 100644
--- a/camel/camel-folder.h
+++ b/camel/camel-folder.h
@@ -105,7 +105,7 @@ typedef struct {
gint (*get_message_count) (CamelFolder *folder);
gint (*append_message) (CamelFolder *folder, CamelMimeMessage *message);
const GList * (*list_permanent_flags) (CamelFolder *folder);
-
+ void (*copy_message_to) (CamelFolder *folder, CamelMimeMessage *message, CamelFolder *dest_folder);
} CamelFolderClass;
@@ -134,6 +134,7 @@ gboolean camel_folder_exists (CamelFolder *folder);
gint camel_folder_get_message_count (CamelFolder *folder);
gint camel_folder_append_message (CamelFolder *folder, CamelMimeMessage *message);
const GList *camel_folder_list_permanent_flags (CamelFolder *folder);
+void camel_folder_copy_message_to (CamelFolder *folder, CamelMimeMessage *message, CamelFolder *dest_folder);
#ifdef __cplusplus
diff --git a/camel/providers/MH/camel-mh-folder.c b/camel/providers/MH/camel-mh-folder.c
index c47a18e1ec..049ad905ab 100644
--- a/camel/providers/MH/camel-mh-folder.c
+++ b/camel/providers/MH/camel-mh-folder.c
@@ -53,6 +53,7 @@ static CamelMimeMessage *_get_message (CamelFolder *folder, gint number);
static gint _get_message_count (CamelFolder *folder);
static gint _append_message (CamelFolder *folder, CamelMimeMessage *message);
static void _expunge (CamelFolder *folder);
+static void _copy_message_to (CamelFolder *folder, CamelMimeMessage *message, CamelFolder *dest_folder);
static void
@@ -74,6 +75,7 @@ camel_mh_folder_class_init (CamelMhFolderClass *camel_mh_folder_class)
camel_folder_class->get_message_count = _get_message_count;
camel_folder_class->append_message = _append_message;
camel_folder_class->expunge = _expunge;
+ camel_folder_class->copy_message_to = _copy_message_to;
}
@@ -616,3 +618,18 @@ _expunge (CamelFolder *folder)
CAMEL_LOG_FULL_DEBUG ("Leaving CamelFolder::expunge\n");
}
+
+
+static void
+_copy_message_to (CamelFolder *folder, CamelMimeMessage *message, CamelFolder *dest_folder)
+{
+ gchar *filename;
+ gchar *dest_filename;
+
+ if (IS_CAMEL_MH_FOLDER (dest_folder)) {
+ /*g_assert (message->parent_folder == folder);*/
+ /* don't have time to finish that today */
+ parent_class->copy_message_to (folder, message, dest_folder);
+ } else
+ parent_class->copy_message_to (folder, message, dest_folder);
+}