- gsize len;
- gsize nread;
- gboolean is_html = FALSE;
- gboolean found;
- gboolean res;
-
-
- if (! tny_mime_part_content_type_is (part, "text/ *") ||
- ! (is_html = tny_mime_part_content_type_is (part, "text/html"))) {
- return FALSE;
+ const gsize len = sizeof (buffer);
+ gsize nread = 0;
+ gboolean is_text_html = FALSE;
+ gboolean found = FALSE;
+ gboolean res = FALSE;
+
+ gboolean is_text = tny_mime_part_content_type_is (part, "text/*");
+ if (!is_text) {
+ g_debug ("%s: tny_mime_part_content_type_is() failed to find a "
+ "text/* MIME part. Content type is %s",
+ __FUNCTION__, "Unknown (calling tny_mime_part_get_content_type(part) causes a deadlock)");
+
+ /* Retry with specific MIME types, because the wildcard seems to fail
+ * in tinymail.
+ * Actually I'm not sure anymore that it fails, so we could probalby
+ * remove this later: murrayc */
+ is_text = (
+ tny_mime_part_content_type_is (part, "text/plain") ||
+ tny_mime_part_content_type_is (part, "text/html") );
+
+ if (is_text) {
+ g_debug ("%s: Retryting with text/plain or text/html succeeded",
+ __FUNCTION__);
+ }
+ }
+
+ if (!is_text) {
+ return FALSE;