From f44f81b7518d96a86219cb3e10108bbfac74d96d Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Tue, 5 May 2020 21:25:36 +0300 Subject: [PATCH] mu: don't verify signatures when it's not needed We were verifying signatures when this was not needed; it seems that gpgme is a bit slow (?), and on some people's machine the extra verification made opening messages slow (with the non-gnus view esp.) --- lib/mu-msg-part.c | 4 ++++ lib/mu-msg.c | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/lib/mu-msg-part.c b/lib/mu-msg-part.c index 5584f946..099274d2 100644 --- a/lib/mu-msg-part.c +++ b/lib/mu-msg-part.c @@ -59,6 +59,10 @@ get_mime_object_at_index (MuMsg *msg, MuMsgOptions opts, unsigned index) ddata.mime_obj = NULL; ddata.index = index; + /* wipe out some irrelevant options */ + opts &= ~MU_MSG_OPTION_VERIFY; + opts &= ~MU_MSG_OPTION_EXTRACT_IMAGES; + mu_msg_part_foreach (msg, opts, (MuMsgPartForeachFunc)do_it_with_index, &ddata); diff --git a/lib/mu-msg.c b/lib/mu-msg.c index e478e2d9..976f3c91 100644 --- a/lib/mu-msg.c +++ b/lib/mu-msg.c @@ -473,6 +473,10 @@ get_body (MuMsg *self, MuMsgOptions opts, gboolean want_html) bdata.want_html = want_html; bdata.gstr = g_string_sized_new (4096); + /* wipe out some irrelevant options */ + opts &= ~MU_MSG_OPTION_VERIFY; + opts &= ~MU_MSG_OPTION_EXTRACT_IMAGES; + mu_msg_part_foreach (self, opts, (MuMsgPartForeachFunc)accumulate_body, &bdata); @@ -522,6 +526,10 @@ get_content_type_parameters (MuMsg *self, MuMsgOptions opts, gboolean want_html) cdata.want_html = want_html; cdata.ctype = NULL; + /* wipe out some irrelevant options */ + opts &= ~MU_MSG_OPTION_VERIFY; + opts &= ~MU_MSG_OPTION_EXTRACT_IMAGES; + mu_msg_part_foreach (self, opts, (MuMsgPartForeachFunc)find_content_type, &cdata);