* mu: try harder to create temp files for images (so we can show them in mu4e)

This commit is contained in:
djcb 2012-09-16 23:10:23 +03:00
parent 7cb695b787
commit 55f7ecd362
2 changed files with 7 additions and 4 deletions

View File

@ -226,6 +226,8 @@ get_temp_file_maybe (MuMsg *msg, MuMsgPart *part, MuMsgOptions opts)
{
char *tmp, *tmpfile;
opts |= MU_MSG_OPTION_USE_EXISTING;
if (!(opts & MU_MSG_OPTION_EXTRACT_IMAGES) ||
g_ascii_strcasecmp (part->type, "image") != 0)
return NULL;

View File

@ -416,13 +416,14 @@ each_part (MuMsg *msg, MuMsgPart *part, GSList **attlist)
char *att, *cachefile;
GError *err;
/* exclude things that don't look like proper attachments */
if (!mu_msg_part_maybe_attachment(part))
/* exclude things that don't look like proper attachments,
* unless they're images */
if (!mu_msg_part_maybe_attachment(part) ||
g_strcmp0 (part->type, "image") != 0)
return;
err = NULL;
cachefile = mu_msg_part_save_temp (msg,
MU_MSG_OPTION_NONE,
cachefile = mu_msg_part_save_temp (msg, MU_MSG_OPTION_NONE,
part->index, &err);
if (!cachefile) {
print_and_clear_g_error (&err);