summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
ca5d719)
added support to show headers in the message view for non multipart
text/enriched and text/html
#include "gtkutils.h"
#include "procmime.h"
#include "html.h"
#include "gtkutils.h"
#include "procmime.h"
#include "html.h"
#include "compose.h"
#include "addressbook.h"
#include "displayheader.h"
#include "compose.h"
#include "addressbook.h"
#include "displayheader.h"
static GdkFont *spacingfont;
static GdkFont *spacingfont;
+static void textview_show_ertf (TextView *textview,
+ FILE *fp,
+ CodeConverter *conv);
static void textview_show_html (TextView *textview,
FILE *fp,
CodeConverter *conv);
static void textview_show_html (TextView *textview,
FILE *fp,
CodeConverter *conv);
boundary_len = strlen(boundary);
}
boundary_len = strlen(boundary);
}
- if (!boundary && mimeinfo->mime_type == MIME_TEXT) {
+ if (!boundary && (mimeinfo->mime_type == MIME_TEXT || mimeinfo->mime_type == MIME_TEXT_HTML || mimeinfo->mime_type == MIME_TEXT_ENRICHED)) {
+
if (fseek(fp, mimeinfo->fpos, SEEK_SET) < 0)
perror("fseek");
headers = textview_scan_header(textview, fp);
if (fseek(fp, mimeinfo->fpos, SEEK_SET) < 0)
perror("fseek");
headers = textview_scan_header(textview, fp);
if (tmpfp) {
if (mimeinfo->mime_type == MIME_TEXT_HTML)
textview_show_html(textview, tmpfp, conv);
if (tmpfp) {
if (mimeinfo->mime_type == MIME_TEXT_HTML)
textview_show_html(textview, tmpfp, conv);
+ else if (mimeinfo->mime_type == MIME_TEXT_ENRICHED)
+ textview_show_ertf(textview, tmpfp, conv);
else
while (fgets(buf, sizeof(buf), tmpfp) != NULL)
textview_write_line(textview, buf, conv);
else
while (fgets(buf, sizeof(buf), tmpfp) != NULL)
textview_write_line(textview, buf, conv);
html_parser_destroy(parser);
}
html_parser_destroy(parser);
}
+static void textview_show_ertf(TextView *textview, FILE *fp,
+ CodeConverter *conv)
+{
+ ERTFParser *parser;
+ gchar *str;
+ gchar* url = NULL;
+
+ parser = ertf_parser_new(fp, conv);
+ g_return_if_fail(parser != NULL);
+
+ while ((str = ertf_parse(parser)) != NULL) {
+ textview_write_line(textview, str, NULL);
+ }
+ ertf_parser_destroy(parser);
+}
+
/* get_uri_part() - retrieves a URI starting from scanpos.
Returns TRUE if succesful */
static gboolean get_uri_part(const gchar *start, const gchar *scanpos,
/* get_uri_part() - retrieves a URI starting from scanpos.
Returns TRUE if succesful */
static gboolean get_uri_part(const gchar *start, const gchar *scanpos,