aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-format.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-03-15 23:19:00 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-03-15 23:19:00 +0800
commit38e751895d3a405598526765826f387ac962a0d1 (patch)
tree774c0ce980fd1fea326abd70172c74ff708c9662 /mail/em-format.c
parentd749d27d5725987dc95ae3ec9b176e13eaac3c43 (diff)
downloadgsoc2013-evolution-38e751895d3a405598526765826f387ac962a0d1.tar
gsoc2013-evolution-38e751895d3a405598526765826f387ac962a0d1.tar.gz
gsoc2013-evolution-38e751895d3a405598526765826f387ac962a0d1.tar.bz2
gsoc2013-evolution-38e751895d3a405598526765826f387ac962a0d1.tar.lz
gsoc2013-evolution-38e751895d3a405598526765826f387ac962a0d1.tar.xz
gsoc2013-evolution-38e751895d3a405598526765826f387ac962a0d1.tar.zst
gsoc2013-evolution-38e751895d3a405598526765826f387ac962a0d1.zip
make this a varags function, which then calls the virtual method to do the
2004-03-15 Not Zed <NotZed@Ximian.com> * em-format.c (em_format_format_error): make this a varags function, which then calls the virtual method to do the work. (emf_multipart_appledouble, emf_multipart_mixed) (emf_multipart_alternative, emf_multipart_related) (emf_message_rfc822): print an error to explain why you're getting source content displayed. (em_format_format_secure): make this a function. and if we're done formatting a secure part, and we dont have a parent anymore, null out the validity. See #55541. svn path=/trunk/; revision=25070
Diffstat (limited to 'mail/em-format.c')
-rw-r--r--mail/em-format.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/mail/em-format.c b/mail/em-format.c
index 9917f1ce8b..cbccba6fc8 100644
--- a/mail/em-format.c
+++ b/mail/em-format.c
@@ -870,6 +870,28 @@ void em_format_set_inline(EMFormat *emf, CamelMimePart *part, int state)
g_hash_table_insert(emf->inline_table, part, GINT_TO_POINTER(state));
}
+void em_format_format_error(EMFormat *emf, CamelStream *stream, const char *fmt, ...)
+{
+ va_list ap;
+ char *txt;
+
+ va_start(ap, fmt);
+ txt = g_strdup_vprintf(fmt, ap);
+ ((EMFormatClass *)G_OBJECT_GET_CLASS(emf))->format_error((emf), (stream), (txt));
+ g_free(txt);
+}
+
+void
+em_format_format_secure(EMFormat *emf, struct _CamelStream *stream, struct _CamelMimePart *part, struct _CamelCipherValidity *valid)
+{
+ ((EMFormatClass *)G_OBJECT_GET_CLASS(emf))->format_secure(emf, stream, part, valid);
+
+ if (emf->valid_parent == NULL && emf->valid != NULL) {
+ camel_cipher_validity_free(emf->valid);
+ emf->valid = NULL;
+ }
+}
+
/* should this be virtual? */
void
em_format_format_content(EMFormat *emf, CamelStream *stream, CamelMimePart *part)
@@ -1059,6 +1081,7 @@ emf_multipart_appledouble(EMFormat *emf, CamelStream *stream, CamelMimePart *par
int len;
if (!CAMEL_IS_MULTIPART(mp)) {
+ em_format_format_error(emf, stream, _("Internal error: expecting CamelMultipart, got \"%s\""), ((CamelObject *)mp)->klass->name);
em_format_format_source(emf, stream, part);
return;
}
@@ -1078,6 +1101,7 @@ emf_multipart_mixed(EMFormat *emf, CamelStream *stream, CamelMimePart *part, con
int i, nparts, len;
if (!CAMEL_IS_MULTIPART(mp)) {
+ em_format_format_error(emf, stream, _("Internal error: expecting CamelMultipart, got \"%s\""), ((CamelObject *)mp)->klass->name);
em_format_format_source(emf, stream, part);
return;
}
@@ -1101,6 +1125,7 @@ emf_multipart_alternative(EMFormat *emf, CamelStream *stream, CamelMimePart *par
CamelMimePart *best = NULL;
if (!CAMEL_IS_MULTIPART(mp)) {
+ em_format_format_error(emf, stream, _("Internal error: expecting CamelMultipart, got \"%s\""), ((CamelObject *)mp)->klass->name);
em_format_format_source(emf, stream, part);
return;
}
@@ -1193,6 +1218,7 @@ emf_multipart_related(EMFormat *emf, CamelStream *stream, CamelMimePart *part, c
EMFormatPURI *puri, *purin;
if (!CAMEL_IS_MULTIPART(mp)) {
+ em_format_format_error(emf, stream, _("Internal error: expecting CamelMultipart, got \"%s\""), ((CamelObject *)mp)->klass->name);
em_format_format_source(emf, stream, part);
return;
}
@@ -1341,6 +1367,7 @@ emf_message_rfc822(EMFormat *emf, CamelStream *stream, CamelMimePart *part, cons
int len;
if (!CAMEL_IS_MIME_MESSAGE(dw)) {
+ em_format_format_error(emf, stream, _("Internal error: expecting CamelMimeMessage, got \"%s\""), ((CamelObject *)dw)->klass->name);
em_format_format_source(emf, stream, part);
return;
}