]> granicus.if.org Git - neomutt/commitdiff
Turn off macro processing during autocrypt initialization
authorKevin McCarthy <kevin@8t8.us>
Thu, 8 Aug 2019 01:34:58 +0000 (18:34 -0700)
committerRichard Russon <rich@flatcap.org>
Mon, 19 Aug 2019 23:14:28 +0000 (00:14 +0100)
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 <rich@flatcap.org>
autocrypt/autocrypt.c

index c4f4675f5b88ec9bf3094d98ec503fe3d3dec64a..a8fe6e5ba5467ebb67afa9a8cf9408e9e0b1a502 100644 (file)
@@ -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;