From: Kevin McCarthy Date: Thu, 8 Aug 2019 01:34:58 +0000 (-0700) Subject: Turn off macro processing during autocrypt initialization X-Git-Tag: 2019-10-25~97^2~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3b2790cb5c808e71ed7978f54b4fbb15de77a289;p=neomutt Turn off macro processing during autocrypt initialization The muttrc can push events into the macro buffer, with the assumption that mailbox will be opened next. This will interfere with the prompts uses during first run. The only issue is that macros won't work inside the folder browser, if invoked. Co-authored-by: Richard Russon --- diff --git a/autocrypt/autocrypt.c b/autocrypt/autocrypt.c index c4f4675f5..a8fe6e5ba 100644 --- a/autocrypt/autocrypt.c +++ b/autocrypt/autocrypt.c @@ -37,6 +37,7 @@ #include "muttlib.h" #include "mx.h" #include "ncrypt/ncrypt.h" +#include "options.h" #include "send.h" /** @@ -94,6 +95,8 @@ int mutt_autocrypt_init(bool can_create) if (!C_Autocrypt || !C_AutocryptDir) return -1; + OptIgnoreMacroEvents = true; + if (autocrypt_dir_init(can_create)) goto bail; @@ -103,9 +106,12 @@ int mutt_autocrypt_init(bool can_create) if (mutt_autocrypt_db_init(can_create)) goto bail; + OptIgnoreMacroEvents = false; + return 0; bail: + OptIgnoreMacroEvents = false; C_Autocrypt = false; mutt_autocrypt_db_close(); return -1;