Revision 3281

View differences:

libsylph/procheader.c
688 688
		case H_CONTENT_TYPE:
689 689
			if (!g_ascii_strncasecmp(hp, "multipart", 9)) {
690 690
				MSG_SET_TMP_FLAGS(msginfo->flags, MSG_MIME);
691
			} else if (!charset) {
692
				procmime_scan_content_type_str
693
					(hp, NULL, &charset, NULL, NULL);
691
			} else {
692
				if (!g_ascii_strncasecmp(hp, "text/html", 9)) {
693
					MSG_SET_TMP_FLAGS(msginfo->flags, MSG_MIME_HTML);
694
				}
695
				if (!charset) {
696
					procmime_scan_content_type_str
697
						(hp, NULL, &charset, NULL, NULL);
698
				}
694 699
			}
695 700
			break;
696 701
		case H_SEEN:
......
740 745
		msginfo->inreplyto =
741 746
			g_strdup((gchar *)msginfo->references->data);
742 747

  
748
	if (MSG_IS_MIME(msginfo->flags)) {
749
		MimeInfo *mimeinfo, *part;
750
		gboolean has_html = FALSE;
751

  
752
		part = mimeinfo = procmime_scan_message_stream(fp);
753
		while (part) {
754
			if (part->mime_type != MIME_TEXT &&
755
			    part->mime_type != MIME_TEXT_HTML &&
756
			    part->mime_type != MIME_MULTIPART)
757
				break;
758
			if (part->mime_type == MIME_TEXT_HTML)
759
				has_html = TRUE;
760
			part = procmime_mimeinfo_next(part);
761
		}
762

  
763
		if (has_html && !part) {
764
			MSG_SET_TMP_FLAGS(msginfo->flags, MSG_MIME_HTML);
765
		}
766

  
767
		procmime_mimeinfo_free_all(mimeinfo);
768
	}
769

  
743 770
	g_free(charset);
744 771

  
745 772
	return msginfo;
libsylph/procmsg.h
89 89
#define MSG_IMAP		(1U << 19)
90 90
#define MSG_NEWS		(1U << 20)
91 91
#define MSG_SIGNED		(1U << 21)
92
#define MSG_MIME_HTML		(1U << 26)
92 93
#define MSG_FLAG_CHANGED	(1U << 27)
93 94
#define MSG_CACHED		(1U << 28)
94 95
#define MSG_MIME		(1U << 29)
95 96
#define MSG_INVALID		(1U << 30)
96 97
#define MSG_RECEIVED		(1U << 31)
97 98

  
98
#define MSG_CACHED_FLAG_MASK	(MSG_MIME)
99
#define MSG_CACHED_FLAG_MASK	(MSG_MIME|MSG_MIME_HTML)
99 100

  
100 101
typedef guint32 MsgTmpFlags;
101 102

  
......
131 132
#define MSG_IS_IMAP(msg)		(((msg).tmp_flags & MSG_IMAP) != 0)
132 133
#define MSG_IS_NEWS(msg)		(((msg).tmp_flags & MSG_NEWS) != 0)
133 134
#define MSG_IS_SIGNED(msg)		(((msg).tmp_flags & MSG_SIGNED) != 0)
135
#define MSG_IS_MIME_HTML(msg)		(((msg).tmp_flags & MSG_MIME_HTML) != 0)
134 136
#define MSG_IS_FLAG_CHANGED(msg)	(((msg).tmp_flags & MSG_FLAG_CHANGED) != 0)
135 137
#define MSG_IS_CACHED(msg)		(((msg).tmp_flags & MSG_CACHED) != 0)
136 138
#define MSG_IS_MIME(msg)		(((msg).tmp_flags & MSG_MIME) != 0)
libsylph/procmime.c
210 210
	return mimeinfo;
211 211
}
212 212

  
213
MimeInfo *procmime_scan_message_stream(FILE *fp)
214
{
215
	MimeInfo *mimeinfo;
216
	glong fpos;
217

  
218
	g_return_val_if_fail(fp != NULL, NULL);
219

  
220
	if (fseek(fp, 0L, SEEK_SET) < 0) {
221
		FILE_OP_ERROR("procmime_scan_message_stream()", "fseek");
222
		return NULL;
223
	}
224

  
225
	mimeinfo = procmime_scan_mime_header(fp);
226

  
227
	if (mimeinfo) {
228
		fpos = ftell(fp);
229
		mimeinfo->content_size = get_left_file_size(fp);
230
		mimeinfo->size = fpos + mimeinfo->content_size;
231
		if (mimeinfo->encoding_type == ENC_BASE64)
232
			mimeinfo->content_size = mimeinfo->content_size / 4 * 3;
233
		if (mimeinfo->mime_type == MIME_MULTIPART ||
234
		    mimeinfo->mime_type == MIME_MESSAGE_RFC822)
235
			procmime_scan_multipart_message(mimeinfo, fp);
236
	}
237

  
238
	return mimeinfo;
239
}
240

  
213 241
void procmime_scan_multipart_message(MimeInfo *mimeinfo, FILE *fp)
214 242
{
215 243
	gchar *p;
libsylph/procmime.h
142 142
MimeInfo *procmime_mimeinfo_next	(MimeInfo	*mimeinfo);
143 143

  
144 144
MimeInfo *procmime_scan_message		(MsgInfo	*msginfo);
145
MimeInfo *procmime_scan_message_stream	(FILE		*fp);
145 146
void procmime_scan_multipart_message	(MimeInfo	*mimeinfo,
146 147
					 FILE		*fp);
147 148

  
src/icons/Makefile.am
32 32
	folder-open.h \
33 33
	folder-noselect.h \
34 34
	folder-search.h \
35
	group.h
35
	group.h \
36
	html.h
36 37

  
37 38
EXTRA_DIST = \
38 39
	stock_addressbook.png \
......
69 70
	folder-noselect.png \
70 71
	folder-search.png \
71 72
	group.png \
73
	html.png \
72 74
	clip.xpm \
73 75
	deleted.xpm \
74 76
	forwarded.xpm \
src/stock_pixmap.c
80 80
#include "icons/folder-noselect.h"
81 81
#include "icons/folder-search.h"
82 82
#include "icons/group.h"
83
#include "icons/html.h"
83 84

  
84 85
typedef struct _StockPixmapData	StockPixmapData;
85 86

  
......
110 111
	{error_xpm	 , NULL, NULL},
111 112
	{forwarded_xpm	 , NULL, NULL},
112 113
	{NULL, NULL, NULL, NULL, group, sizeof(group), "group", 0},
114
	{NULL, NULL, NULL, NULL, html, sizeof(html), "html", 0},
113 115
	{interface_xpm	 , NULL, NULL},
114 116
	{jpilot_xpm	 , NULL, NULL},
115 117
	{ldap_xpm	 , NULL, NULL},
src/stock_pixmap.h
38 38
	STOCK_PIXMAP_ERROR,
39 39
	STOCK_PIXMAP_FORWARDED,
40 40
	STOCK_PIXMAP_GROUP,
41
	STOCK_PIXMAP_HTML,
41 42
	STOCK_PIXMAP_INTERFACE,
42 43
	STOCK_PIXMAP_JPILOT,
43 44
	STOCK_PIXMAP_LDAP,
src/summaryview.c
139 139
static GdkPixbuf *forwarded_pixbuf;
140 140

  
141 141
static GdkPixbuf *clip_pixbuf;
142
static GdkPixbuf *html_pixbuf;
142 143

  
143 144
static void summary_clear_list_full	(SummaryView		*summaryview,
144 145
					 gboolean		 is_refresh);
......
624 625
			 &forwarded_pixbuf);
625 626
	stock_pixbuf_gdk(summaryview->treeview, STOCK_PIXMAP_CLIP,
626 627
			 &clip_pixbuf);
628
	stock_pixbuf_gdk(summaryview->treeview, STOCK_PIXMAP_HTML,
629
			 &html_pixbuf);
627 630

  
628 631
	font_desc = pango_font_description_new();
629 632
	size = pango_font_description_get_size
......
2473 2476
	else if (MSG_IS_FORWARDED(flags))
2474 2477
		unread_pix = forwarded_pixbuf;
2475 2478

  
2476
	if (MSG_IS_MIME(flags))
2479
	if (MSG_IS_MIME(flags)) {
2477 2480
		mime_pix = clip_pixbuf;
2481
	}
2482
	if (MSG_IS_MIME_HTML(flags)) {
2483
		mime_pix = html_pixbuf;
2484
	}
2478 2485

  
2479 2486
	if (prefs_common.bold_unread) {
2480 2487
		if (MSG_IS_UNREAD(flags))
configure.in
9 9
MICRO_VERSION=0
10 10
INTERFACE_AGE=0
11 11
BINARY_AGE=0
12
EXTRA_VERSION=beta5
13
BUILD_REVISION=1149
12
EXTRA_VERSION=beta6
13
BUILD_REVISION=1150
14 14
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
15 15

  
16 16
dnl define if this is a development release
ChangeLog
1
2013-09-13
2

  
3
	* libsylph/procheader.c
4
	  libsylph/procmsg.h
5
	  libsylph/procmime.[ch]
6
	  src/icons/html.png
7
	  src/icons/Makefile.am
8
	  src/stock_pixmap.[ch]
9
	  src/summaryview.c: distinguish icon for HTML mail and other mail
10
	  with attachments on summaryview (#84) (Thanks to Hayashi).
11

  
1 12
2013-09-11
2 13

  
3 14
	* src/quick_search.[ch]

Also available in: Unified diff