aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--mail/ChangeLog12
-rw-r--r--mail/em-format.c27
-rw-r--r--mail/em-format.h4
3 files changed, 41 insertions, 2 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index a6a76d7a2f..8b1b6bf55a 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,15 @@
+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.
+
2004-03-12 Jeffrey Stedfast <fejj@ximian.com>
* em-folder-browser.c (emfb_search_search_activated): No-op if
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;
}
diff --git a/mail/em-format.h b/mail/em-format.h
index 4b3956f4c0..14db358e58 100644
--- a/mail/em-format.h
+++ b/mail/em-format.h
@@ -221,11 +221,11 @@ void em_format_pull_level(EMFormat *emf);
((EMFormat *)(emf))->uid, \
((EMFormat *)(emf))->message, \
(emf))
-#define em_format_format_error(emf, stream, txt) ((EMFormatClass *)G_OBJECT_GET_CLASS(emf))->format_error((emf), (stream), (txt))
+void em_format_format_error(EMFormat *emf, struct _CamelStream *stream, const char *fmt, ...);
#define em_format_format_attachment(emf, stream, msg, type, info) ((EMFormatClass *)G_OBJECT_GET_CLASS(emf))->format_attachment((emf), (stream), (msg), (type), (info))
#define em_format_format_message(emf, stream, msg) ((EMFormatClass *)G_OBJECT_GET_CLASS(emf))->format_message((emf), (stream), (msg))
#define em_format_format_source(emf, stream, msg) ((EMFormatClass *)G_OBJECT_GET_CLASS(emf))->format_source((emf), (stream), (msg))
-#define em_format_format_secure(emf, stream, msg, valid) ((EMFormatClass *)G_OBJECT_GET_CLASS(emf))->format_secure((emf), (stream), (msg), (valid))
+void em_format_format_secure(EMFormat *emf, struct _CamelStream *stream, struct _CamelMimePart *part, struct _CamelCipherValidity *valid);
#define em_format_busy(emf) ((EMFormatClass *)G_OBJECT_GET_CLASS(emf))->busy((emf))