Improve decrypt failure handling

On failure to decrypt, list the encrypted part as an attachment
This commit is contained in:
Foivos S. Zakkak 2014-10-18 12:33:20 +03:00
parent c40522b632
commit a79cd23cd1
1 changed files with 13 additions and 3 deletions

View File

@ -381,6 +381,7 @@ handle_encrypted_part (MuMsg *msg,
MuMsgPartForeachFunc func, gpointer user_data)
{
GError *err;
gboolean rv;
GMimeObject *dec;
MuMsgPartPasswordFunc pw_func;
@ -398,14 +399,23 @@ handle_encrypted_part (MuMsg *msg,
}
if (dec) {
gboolean rv;
rv = handle_mime_object (msg, dec, parent, opts,
index, func, user_data);
g_object_unref (dec);
return rv;
} else {
// On failure to decrypt, list the encrypted part as
// an attachment
GMimeObject *encrypted;
encrypted = g_mime_multipart_get_part (GMIME_MULTIPART (part), 1);
g_return_val_if_fail (GMIME_IS_PART(encrypted), FALSE);
rv = handle_mime_object (msg, encrypted, parent, opts,
index, func, user_data);
}
return TRUE;
return rv;
}