aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-multipart.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/camel-multipart.c')
-rw-r--r--camel/camel-multipart.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/camel/camel-multipart.c b/camel/camel-multipart.c
index 836297a1c8..076ec3af76 100644
--- a/camel/camel-multipart.c
+++ b/camel/camel-multipart.c
@@ -44,6 +44,7 @@
#define d(x)
+static gboolean is_offline (CamelDataWrapper *data_wrapper);
static void add_part (CamelMultipart *multipart,
CamelMimePart *part);
static void add_part_at (CamelMultipart *multipart,
@@ -94,6 +95,7 @@ camel_multipart_class_init (CamelMultipartClass *camel_multipart_class)
/* virtual method overload */
camel_data_wrapper_class->write_to_stream = write_to_stream;
+ camel_data_wrapper_class->is_offline = is_offline;
}
static void
@@ -414,6 +416,24 @@ camel_multipart_get_boundary (CamelMultipart *multipart)
return CMP_CLASS (multipart)->get_boundary (multipart);
}
+static gboolean
+is_offline (CamelDataWrapper *data_wrapper)
+{
+ CamelMultipart *multipart = CAMEL_MULTIPART (data_wrapper);
+ GList *node;
+ CamelDataWrapper *part;
+
+ if (parent_class->is_offline (data_wrapper))
+ return TRUE;
+ for (node = multipart->parts; node; node = node->next) {
+ part = node->data;
+ if (camel_data_wrapper_is_offline (part))
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
/* this is MIME specific, doesn't belong here really */
static int
write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)