This will be needed for the first-run of autocrypt initialization.
The initialization involves a number of prompts, and can even use the
folder browser. The browser could in turn connect to IMAP which might
invoke a certificate prompt, login prompt, etc.
int mutt_get_field_unbuffered (char *msg, char *buf, size_t buflen, int flags)
{
- int rc;
+ int rc, reset_ignoremacro = 0;
- set_option (OPTIGNOREMACROEVENTS);
+ if (!option (OPTIGNOREMACROEVENTS))
+ {
+ set_option (OPTIGNOREMACROEVENTS);
+ reset_ignoremacro = 1;
+ }
rc = mutt_get_field (msg, buf, buflen, flags);
- unset_option (OPTIGNOREMACROEVENTS);
+ if (reset_ignoremacro)
+ unset_option (OPTIGNOREMACROEVENTS);
return (rc);
}
BUFFER *drow = NULL;
unsigned u;
FILE *fp;
- int allow_skip = 0;
+ int allow_skip = 0, reset_ignoremacro = 0;
mutt_push_current_menu (menu);
menu->help = helpstr;
done = 0;
- set_option(OPTIGNOREMACROEVENTS);
+
+ if (!option (OPTIGNOREMACROEVENTS))
+ {
+ set_option (OPTIGNOREMACROEVENTS);
+ reset_ignoremacro = 1;
+ }
while (!done)
{
switch (mutt_menuLoop (menu))
break;
}
}
- unset_option(OPTIGNOREMACROEVENTS);
+ if (reset_ignoremacro)
+ unset_option (OPTIGNOREMACROEVENTS);
mutt_buffer_pool_release (&drow);
mutt_pop_current_menu (menu);
BUFFER *drow = NULL;
FILE *fp;
gnutls_datum_t pemdata;
- int done, ret;
+ int done, ret, reset_ignoremacro = 0;
if (!tls_check_preauth (certdata, certstat, hostname, idx, &certerr,
&savedcert))
menu->help = helpstr;
done = 0;
- set_option (OPTIGNOREMACROEVENTS);
+ if (!option (OPTIGNOREMACROEVENTS))
+ {
+ set_option (OPTIGNOREMACROEVENTS);
+ reset_ignoremacro = 1;
+ }
while (!done)
{
switch (mutt_menuLoop (menu))
break;
}
}
- unset_option (OPTIGNOREMACROEVENTS);
+ if (reset_ignoremacro)
+ unset_option (OPTIGNOREMACROEVENTS);
mutt_buffer_pool_release (&drow);
mutt_pop_current_menu (menu);