mirror of https://github.com/djcb/mu.git
mu: improve crypto handling
This commit is contained in:
parent
dd057b11aa
commit
c22eb434b7
|
@ -481,6 +481,27 @@ looks_like_text_body_part (GMimeContentType *ctype)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static MuMsgPartSigStatusReport*
|
||||||
|
copy_status_report_maybe (GObject *obj)
|
||||||
|
{
|
||||||
|
MuMsgPartSigStatusReport *report, *copy;
|
||||||
|
|
||||||
|
report = g_object_get_data (obj, SIG_STATUS_REPORT);
|
||||||
|
if (!report)
|
||||||
|
return NULL; /* nothing to copy */
|
||||||
|
|
||||||
|
copy = g_new0(MuMsgPartSigStatusReport, 1);
|
||||||
|
copy->verdict = report->verdict;
|
||||||
|
|
||||||
|
if (report->report)
|
||||||
|
copy->report = g_strdup (report->report);
|
||||||
|
if (report->signers)
|
||||||
|
copy->signers = g_strdup (report->signers);
|
||||||
|
|
||||||
|
return copy;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* call 'func' with information about this MIME-part */
|
/* call 'func' with information about this MIME-part */
|
||||||
static gboolean
|
static gboolean
|
||||||
|
@ -520,10 +541,7 @@ handle_part (MuMsg *msg, GMimePart *part, GMimeObject *parent,
|
||||||
if (g_ascii_strcasecmp (msgpart.subtype, "pgp-signature") == 0 ||
|
if (g_ascii_strcasecmp (msgpart.subtype, "pgp-signature") == 0 ||
|
||||||
decrypted) {
|
decrypted) {
|
||||||
msgpart.sig_status_report =
|
msgpart.sig_status_report =
|
||||||
(MuMsgPartSigStatusReport*)
|
copy_status_report_maybe (G_OBJECT(parent));
|
||||||
g_object_get_data (G_OBJECT(parent),
|
|
||||||
SIG_STATUS_REPORT);
|
|
||||||
|
|
||||||
if (msgpart.sig_status_report)
|
if (msgpart.sig_status_report)
|
||||||
msgpart.part_type |= MU_MSG_PART_TYPE_SIGNED;
|
msgpart.part_type |= MU_MSG_PART_TYPE_SIGNED;
|
||||||
}
|
}
|
||||||
|
@ -533,6 +551,8 @@ handle_part (MuMsg *msg, GMimePart *part, GMimeObject *parent,
|
||||||
|
|
||||||
func (msg, &msgpart, user_data);
|
func (msg, &msgpart, user_data);
|
||||||
|
|
||||||
|
mu_msg_part_sig_status_report_destroy (msgpart.sig_status_report);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1152,8 +1152,6 @@ make_command_map (Context& context)
|
||||||
{"type", ArgInfo{Type::Symbol, true,
|
{"type", ArgInfo{Type::Symbol, true,
|
||||||
"type of composition: reply/forward/edit/resend/new"}},
|
"type of composition: reply/forward/edit/resend/new"}},
|
||||||
{"docid", ArgInfo{Type::Integer, false,"document id of parent-message, if any"}},
|
{"docid", ArgInfo{Type::Integer, false,"document id of parent-message, if any"}},
|
||||||
{"extract-images", ArgInfo{Type::Symbol, false,
|
|
||||||
"whether to extract images for this messages (if any)"}},
|
|
||||||
{"extract-encrypted", ArgInfo{Type::Symbol, false,
|
{"extract-encrypted", ArgInfo{Type::Symbol, false,
|
||||||
"whether to decrypt encrypted parts (if any)" }}},
|
"whether to decrypt encrypted parts (if any)" }}},
|
||||||
"get contact information",
|
"get contact information",
|
||||||
|
|
Loading…
Reference in New Issue