aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-format.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-02-06 14:35:50 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-02-06 14:35:50 +0800
commit2f07bc4e16c3bc41c75a8ddb17d29a902e0f3b1b (patch)
tree4173cb4ea18780cbe613995f89c7b50d39ac1399 /mail/em-format.c
parent734a27187b7c4495f377c8533f9affdcf860dbbc (diff)
downloadgsoc2013-evolution-2f07bc4e16c3bc41c75a8ddb17d29a902e0f3b1b.tar
gsoc2013-evolution-2f07bc4e16c3bc41c75a8ddb17d29a902e0f3b1b.tar.gz
gsoc2013-evolution-2f07bc4e16c3bc41c75a8ddb17d29a902e0f3b1b.tar.bz2
gsoc2013-evolution-2f07bc4e16c3bc41c75a8ddb17d29a902e0f3b1b.tar.lz
gsoc2013-evolution-2f07bc4e16c3bc41c75a8ddb17d29a902e0f3b1b.tar.xz
gsoc2013-evolution-2f07bc4e16c3bc41c75a8ddb17d29a902e0f3b1b.tar.zst
gsoc2013-evolution-2f07bc4e16c3bc41c75a8ddb17d29a902e0f3b1b.zip
** See bug #53258.
2004-02-06 Not Zed <NotZed@Ximian.com> ** See bug #53258. * em-format-html-display.c (efhd_find_handler): force any bonobo handler types to always be inline, even attachments. * em-format.c (em_format_is_inline): use handler flags for special cases, removing all hard-coded types. * em-format.h (EMFormatHandler): add a flags field, so far a flag to set default inline viewing of the content. 2004-02-06 Not Zed <NotZed@Ximian.com> * em-folder-properties.c: include string.h to kill warning. ** See bug #53627. * em-folder-view.c (emfv_popup_mark_junk): changed to work like delete does, jumping to the next message if required, and marking things immediately, then queuing up the junk marking job if required. * mail-ops.c (mail_mark_junk): ugh, this stuff totally can't go accessing messagelist from another thread!!!! Changed so this code only does the junk reporting, not setting flags. UGH! It should be doing this implictly on the folder when you set the flags, or at least when you sync the folder!!! Changed ot use the queued thread. * message-list.c (find_next_undeleted): changed to find next-unhidden, i.e. junk as well as deleted, if we're in hide-deleted mode. (build_tree): always call find_next_undeleted if we have a cursor. (build_flat): same. svn path=/trunk/; revision=24644
Diffstat (limited to 'mail/em-format.c')
-rw-r--r--mail/em-format.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/mail/em-format.c b/mail/em-format.c
index d0b5786492..816b2f7c25 100644
--- a/mail/em-format.c
+++ b/mail/em-format.c
@@ -821,39 +821,38 @@ int em_format_is_attachment(EMFormat *emf, CamelMimePart *part)
* em_format_is_inline:
* @emf:
* @part:
+ * @handle: handler for this part
*
* Returns true if the part should be displayed inline. Any part with
- * a Content-Disposition of inline, or any message type is displayed
- * inline.
+ * a Content-Disposition of inline, or if the @handle has a default
+ * inline set, will be shown inline.
*
- * ::set_inline() called on the same part will override any calculated
+ * :set_inline() called on the same part will override any calculated
* value.
*
* Return value:
**/
-int em_format_is_inline(EMFormat *emf, CamelMimePart *part)
+int em_format_is_inline(EMFormat *emf, CamelMimePart *part, const EMFormatHandler *handle)
{
void *dummy, *override;
const char *tmp;
- CamelContentType *ct;
+
+ if (handle == NULL)
+ return FALSE;
if (g_hash_table_lookup_extended(emf->inline_table, part, &dummy, &override))
return GPOINTER_TO_INT(override);
- ct = camel_mime_part_get_content_type(part);
-
- /* TODO: make this depend on libnss supported */
- /* For some reason rfc2633 says we always add this as an attachment, which
- stuffs us up since we don't want to treat it that way at all ... */
- if (camel_content_type_is(ct, "application", "x-pkcs7-mime"))
+ /* some types need to override the disposition, e.g. application/x-pkcs7-mime */
+ if (handle->flags & EM_FORMAT_HANDLER_INLINE_DISPOSITION)
return TRUE;
tmp = camel_mime_part_get_disposition(part);
if (tmp)
return g_ascii_strcasecmp(tmp, "inline") == 0;
- /* messages are always inline? */
- return camel_content_type_is (ct, "message", "*");
+ /* otherwise, use the default for this handler type */
+ return (handle->flags & EM_FORMAT_HANDLER_INLINE) != 0;
}
/**
@@ -1348,7 +1347,7 @@ emf_message_rfc822(EMFormat *emf, CamelStream *stream, CamelMimePart *part, cons
static EMFormatHandler type_builtin_table[] = {
#ifdef HAVE_NSS
- { "application/x-pkcs7-mime", (EMFormatFunc)emf_application_xpkcs7mime },
+ { "application/x-pkcs7-mime", (EMFormatFunc)emf_application_xpkcs7mime, EM_FORMAT_HANDLER_INLINE_DISPOSITION },
#endif
{ "multipart/alternative", emf_multipart_alternative },
{ "multipart/appledouble", emf_multipart_appledouble },
@@ -1357,13 +1356,13 @@ static EMFormatHandler type_builtin_table[] = {
{ "multipart/signed", emf_multipart_signed },
{ "multipart/related", emf_multipart_related },
{ "multipart/*", emf_multipart_mixed },
- { "message/rfc822", emf_message_rfc822 },
- { "message/news", emf_message_rfc822 },
- { "message/*", emf_message_rfc822 },
+ { "message/rfc822", emf_message_rfc822, EM_FORMAT_HANDLER_INLINE },
+ { "message/news", emf_message_rfc822, EM_FORMAT_HANDLER_INLINE },
+ { "message/*", emf_message_rfc822, EM_FORMAT_HANDLER_INLINE },
/* Insert brokenly-named parts here */
#ifdef HAVE_NSS
- { "application/pkcs7-mime", (EMFormatFunc)emf_application_xpkcs7mime },
+ { "application/pkcs7-mime", (EMFormatFunc)emf_application_xpkcs7mime, EM_FORMAT_HANDLER_INLINE_DISPOSITION },
#endif
};