snprintf(buf, sizeof(buf), "%s/%s", TYPE(cur->content), cur->content->subtype);
mutt_parse_mime_message(Context, cur);
- mutt_message_hook(Context, cur, MUTT_MESSAGEHOOK);
+ mutt_message_hook(Context, cur, MUTT_MESSAGE_HOOK);
/* see if crypto is needed for this message. if so, we should exit curses */
if ((WithCrypto != 0) && cur->security)
if (h)
{
- mutt_message_hook(Context, h, MUTT_MESSAGEHOOK);
+ mutt_message_hook(Context, h, MUTT_MESSAGE_HOOK);
if ((WithCrypto != 0) && decode)
{
if (!message_is_tagged(Context, i))
continue;
- mutt_message_hook(Context, Context->hdrs[i], MUTT_MESSAGEHOOK);
+ mutt_message_hook(Context, Context->hdrs[i], MUTT_MESSAGE_HOOK);
mutt_parse_mime_message(Context, Context->hdrs[i]);
if (Context->hdrs[i]->security & ENCRYPT &&
!crypt_valid_passphrase(Context->hdrs[i]->security))
if (!message_is_tagged(Context, i))
continue;
- mutt_message_hook(Context, Context->hdrs[i], MUTT_MESSAGEHOOK);
+ mutt_message_hook(Context, Context->hdrs[i], MUTT_MESSAGE_HOOK);
mutt_endwin();
thepid = mutt_create_filter(cmd, &fpout, NULL, NULL);
if (thepid < 0)
if (!message_is_tagged(Context, i))
continue;
- mutt_message_hook(Context, Context->hdrs[i], MUTT_MESSAGEHOOK);
+ mutt_message_hook(Context, Context->hdrs[i], MUTT_MESSAGE_HOOK);
pipe_msg(Context->hdrs[i], fpout, decode, print);
/* add the message separator */
if (sep)
need_passphrase = (h->security & ENCRYPT);
app = h->security;
}
- mutt_message_hook(Context, h, MUTT_MESSAGEHOOK);
+ mutt_message_hook(Context, h, MUTT_MESSAGE_HOOK);
mutt_default_save(buf, sizeof(buf), h);
}
else
if (h)
{
- mutt_message_hook(Context, h, MUTT_MESSAGEHOOK);
+ mutt_message_hook(Context, h, MUTT_MESSAGE_HOOK);
mutt_default_save(buf, sizeof(buf), h);
if (WithCrypto)
{
if (!message_is_tagged(Context, i))
continue;
- mutt_message_hook(Context, Context->hdrs[i], MUTT_MESSAGEHOOK);
+ mutt_message_hook(Context, Context->hdrs[i], MUTT_MESSAGE_HOOK);
rc = mutt_save_message_ctx(Context->hdrs[i], delete, decode, decrypt, &ctx);
if (rc != 0)
break;
{
case OP_COMPOSE_EDIT_FROM:
edit_address_list(HDR_FROM, &msg->env->from);
- mutt_message_hook(NULL, msg, MUTT_SEND2HOOK);
+ mutt_message_hook(NULL, msg, MUTT_SEND2_HOOK);
break;
case OP_COMPOSE_EDIT_TO:
#ifdef USE_NNTP
crypt_opportunistic_encrypt(msg);
redraw_crypt_lines(msg);
}
- mutt_message_hook(NULL, msg, MUTT_SEND2HOOK);
+ mutt_message_hook(NULL, msg, MUTT_SEND2_HOOK);
break;
case OP_COMPOSE_EDIT_BCC:
#ifdef USE_NNTP
crypt_opportunistic_encrypt(msg);
redraw_crypt_lines(msg);
}
- mutt_message_hook(NULL, msg, MUTT_SEND2HOOK);
+ mutt_message_hook(NULL, msg, MUTT_SEND2_HOOK);
break;
case OP_COMPOSE_EDIT_CC:
#ifdef USE_NNTP
crypt_opportunistic_encrypt(msg);
redraw_crypt_lines(msg);
}
- mutt_message_hook(NULL, msg, MUTT_SEND2HOOK);
+ mutt_message_hook(NULL, msg, MUTT_SEND2_HOOK);
break;
#ifdef USE_NNTP
case OP_COMPOSE_EDIT_NEWSGROUPS:
else
mutt_window_clrtoeol(MuttIndexWindow);
}
- mutt_message_hook(NULL, msg, MUTT_SEND2HOOK);
+ mutt_message_hook(NULL, msg, MUTT_SEND2_HOOK);
break;
case OP_COMPOSE_EDIT_REPLY_TO:
edit_address_list(HDR_REPLYTO, &msg->env->reply_to);
- mutt_message_hook(NULL, msg, MUTT_SEND2HOOK);
+ mutt_message_hook(NULL, msg, MUTT_SEND2_HOOK);
break;
case OP_COMPOSE_EDIT_FCC:
mutt_str_strfcpy(buf, fcc, sizeof(buf));
mutt_paddstr(W, fcc);
fcc_set = 1;
}
- mutt_message_hook(NULL, msg, MUTT_SEND2HOOK);
+ mutt_message_hook(NULL, msg, MUTT_SEND2_HOOK);
break;
case OP_COMPOSE_EDIT_MESSAGE:
if (Editor && (mutt_str_strcmp("builtin", Editor) != 0) && !EditHeaders)
mutt_edit_file(Editor, msg->content->filename);
mutt_update_encoding(msg->content);
menu->redraw = REDRAW_FULL;
- mutt_message_hook(NULL, msg, MUTT_SEND2HOOK);
+ mutt_message_hook(NULL, msg, MUTT_SEND2_HOOK);
break;
}
/* fallthrough */
}
menu->redraw = REDRAW_FULL;
- mutt_message_hook(NULL, msg, MUTT_SEND2HOOK);
+ mutt_message_hook(NULL, msg, MUTT_SEND2_HOOK);
break;
case OP_COMPOSE_ATTACH_KEY:
menu->redraw |= REDRAW_STATUS;
- mutt_message_hook(NULL, msg, MUTT_SEND2HOOK);
+ mutt_message_hook(NULL, msg, MUTT_SEND2_HOOK);
break;
case OP_COMPOSE_MOVE_UP:
menu->redraw |= REDRAW_INDEX | REDRAW_STATUS;
}
- mutt_message_hook(NULL, msg, MUTT_SEND2HOOK);
+ mutt_message_hook(NULL, msg, MUTT_SEND2_HOOK);
break;
case OP_COMPOSE_ATTACH_MESSAGE:
Sort = old_sort;
SortAux = old_sort_aux;
}
- mutt_message_hook(NULL, msg, MUTT_SEND2HOOK);
+ mutt_message_hook(NULL, msg, MUTT_SEND2_HOOK);
break;
case OP_DELETE:
if (menu->current == 0)
msg->content = actx->idx[0]->content;
- mutt_message_hook(NULL, msg, MUTT_SEND2HOOK);
+ mutt_message_hook(NULL, msg, MUTT_SEND2_HOOK);
break;
case OP_COMPOSE_TOGGLE_RECODE:
else
mutt_message(_("The current attachment will be converted."));
menu->redraw = REDRAW_CURRENT;
- mutt_message_hook(NULL, msg, MUTT_SEND2HOOK);
+ mutt_message_hook(NULL, msg, MUTT_SEND2_HOOK);
break;
}
mutt_str_replace(&CURATTACH->content->description, buf);
menu->redraw = REDRAW_CURRENT;
}
- mutt_message_hook(NULL, msg, MUTT_SEND2HOOK);
+ mutt_message_hook(NULL, msg, MUTT_SEND2_HOOK);
break;
case OP_COMPOSE_UPDATE_ENCODING:
mutt_update_encoding(CURATTACH->content);
menu->redraw = REDRAW_CURRENT | REDRAW_STATUS;
}
- mutt_message_hook(NULL, msg, MUTT_SEND2HOOK);
+ mutt_message_hook(NULL, msg, MUTT_SEND2_HOOK);
break;
case OP_COMPOSE_TOGGLE_DISPOSITION:
menu->redraw = REDRAW_CURRENT;
}
- mutt_message_hook(NULL, msg, MUTT_SEND2HOOK);
+ mutt_message_hook(NULL, msg, MUTT_SEND2_HOOK);
break;
case OP_COMPOSE_EDIT_LANGUAGE:
}
else
mutt_warning(_("Empty Content-Language"));
- mutt_message_hook(NULL, msg, MUTT_SEND2HOOK);
+ mutt_message_hook(NULL, msg, MUTT_SEND2_HOOK);
break;
case OP_COMPOSE_EDIT_ENCODING:
else
mutt_error(_("Invalid encoding."));
}
- mutt_message_hook(NULL, msg, MUTT_SEND2HOOK);
+ mutt_message_hook(NULL, msg, MUTT_SEND2_HOOK);
break;
case OP_COMPOSE_SEND_MESSAGE:
mutt_edit_file(NONULL(Editor), CURATTACH->content->filename);
mutt_update_encoding(CURATTACH->content);
menu->redraw = REDRAW_CURRENT | REDRAW_STATUS;
- mutt_message_hook(NULL, msg, MUTT_SEND2HOOK);
+ mutt_message_hook(NULL, msg, MUTT_SEND2_HOOK);
break;
case OP_COMPOSE_TOGGLE_UNLINK:
if (CURATTACH->content->stamp >= st.st_mtime)
mutt_stamp_attachment(CURATTACH->content);
}
- mutt_message_hook(NULL, msg, MUTT_SEND2HOOK);
+ mutt_message_hook(NULL, msg, MUTT_SEND2_HOOK);
break;
case OP_COMPOSE_NEW_MIME:
menu->redraw = REDRAW_FULL;
}
}
- mutt_message_hook(NULL, msg, MUTT_SEND2HOOK);
+ mutt_message_hook(NULL, msg, MUTT_SEND2_HOOK);
break;
case OP_COMPOSE_EDIT_MIME:
mutt_update_encoding(CURATTACH->content);
menu->redraw = REDRAW_FULL;
}
- mutt_message_hook(NULL, msg, MUTT_SEND2HOOK);
+ mutt_message_hook(NULL, msg, MUTT_SEND2_HOOK);
break;
case OP_VIEW_ATTACH:
if (op == OP_FILTER) /* cte might have changed */
menu->redraw = menu->tagprefix ? REDRAW_FULL : REDRAW_CURRENT;
menu->redraw |= REDRAW_STATUS;
- mutt_message_hook(NULL, msg, MUTT_SEND2HOOK);
+ mutt_message_hook(NULL, msg, MUTT_SEND2_HOOK);
break;
case OP_EXIT:
}
msg->security = crypt_pgp_send_menu(msg);
redraw_crypt_lines(msg);
- mutt_message_hook(NULL, msg, MUTT_SEND2HOOK);
+ mutt_message_hook(NULL, msg, MUTT_SEND2_HOOK);
break;
case OP_FORGET_PASSPHRASE:
}
msg->security = crypt_smime_send_menu(msg);
redraw_crypt_lines(msg);
- mutt_message_hook(NULL, msg, MUTT_SEND2HOOK);
+ mutt_message_hook(NULL, msg, MUTT_SEND2_HOOK);
break;
#ifdef MIXMASTER
case OP_COMPOSE_MIX:
mix_make_chain(&msg->chain);
- mutt_message_hook(NULL, msg, MUTT_SEND2HOOK);
+ mutt_message_hook(NULL, msg, MUTT_SEND2_HOOK);
break;
#endif
}
/**
* find_hook - Find a hook to match a path
- * @param type Type of hook, e.g. #MUTT_CLOSEHOOK
+ * @param type Type of hook, e.g. #MUTT_CLOSE_HOOK
* @param path Filename to test
* @retval ptr Matching hook command
* @retval NULL No matches
* open-hook '\.gz$' "gzip -cd '%f' > '%t'"
*
* Call:
- * find_hook (#MUTT_OPENHOOK, "myfile.gz");
+ * find_hook (#MUTT_OPEN_HOOK, "myfile.gz");
*/
static const char *find_hook(int type, const char *path)
{
return ctx->compress_info;
/* Open is compulsory */
- const char *o = find_hook(MUTT_OPENHOOK, ctx->path);
+ const char *o = find_hook(MUTT_OPEN_HOOK, ctx->path);
if (!o)
return NULL;
- const char *c = find_hook(MUTT_CLOSEHOOK, ctx->path);
- const char *a = find_hook(MUTT_APPENDHOOK, ctx->path);
+ const char *c = find_hook(MUTT_CLOSE_HOOK, ctx->path);
+ const char *a = find_hook(MUTT_APPEND_HOOK, ctx->path);
struct CompressInfo *ci = mutt_mem_calloc(1, sizeof(struct CompressInfo));
ctx->compress_info = ci;
if (!path)
return false;
- if (find_hook(MUTT_OPENHOOK, path))
+ if (find_hook(MUTT_OPEN_HOOK, path))
return true;
else
return false;
oldcount = Context ? Context->msgcount : 0;
- mutt_startup_shutdown_hook(MUTT_SHUTDOWNHOOK);
+ mutt_startup_shutdown_hook(MUTT_SHUTDOWN_HOOK);
if (!Context || (check = mx_mbox_close(Context, &index_hint)) == 0)
done = true;
mutt_buffer_init(&pattern);
mutt_buffer_init(&command);
- if (~data & MUTT_GLOBALHOOK) /* NOT a global hook */
+ if (~data & MUTT_GLOBAL_HOOK) /* NOT a global hook */
{
if (*s->dptr == '!')
{
}
mutt_extract_token(&command, s,
- (data & (MUTT_FOLDERHOOK | MUTT_SENDHOOK | MUTT_SEND2HOOK |
- MUTT_ACCOUNTHOOK | MUTT_REPLYHOOK)) ?
+ (data & (MUTT_FOLDER_HOOK | MUTT_SEND_HOOK | MUTT_SEND2_HOOK |
+ MUTT_ACCOUNT_HOOK | MUTT_REPLY_HOOK)) ?
MUTT_TOKEN_SPACE :
0);
goto error;
}
- if (data & (MUTT_FOLDERHOOK | MUTT_MBOXHOOK))
+ if (data & (MUTT_FOLDER_HOOK | MUTT_MBOX_HOOK))
{
/* Accidentally using the ^ mailbox shortcut in the .neomuttrc is a
* common mistake */
pattern.data = mutt_str_strdup(path);
}
#ifdef USE_COMPRESSED
- else if (data & (MUTT_APPENDHOOK | MUTT_OPENHOOK | MUTT_CLOSEHOOK))
+ else if (data & (MUTT_APPEND_HOOK | MUTT_OPEN_HOOK | MUTT_CLOSE_HOOK))
{
if (mutt_comp_valid_command(command.data) == 0)
{
}
}
#endif
- else if (DefaultHook && (~data & MUTT_GLOBALHOOK) &&
- !(data & (MUTT_CHARSETHOOK | MUTT_ICONVHOOK | MUTT_ACCOUNTHOOK)) &&
- (!WithCrypto || !(data & MUTT_CRYPTHOOK)))
+ else if (DefaultHook && (~data & MUTT_GLOBAL_HOOK) &&
+ !(data & (MUTT_CHARSET_HOOK | MUTT_ICONV_HOOK | MUTT_ACCOUNT_HOOK)) &&
+ (!WithCrypto || !(data & MUTT_CRYPT_HOOK)))
{
char tmp[HUGE_STRING];
pattern.data = mutt_str_strdup(tmp);
}
- if (data & (MUTT_MBOXHOOK | MUTT_SAVEHOOK | MUTT_FCCHOOK))
+ if (data & (MUTT_MBOX_HOOK | MUTT_SAVE_HOOK | MUTT_FCC_HOOK))
{
mutt_str_strfcpy(path, command.data, sizeof(path));
mutt_expand_path(path, sizeof(path));
/* check to make sure that a matching hook doesn't already exist */
TAILQ_FOREACH(ptr, &Hooks, entries)
{
- if (data & MUTT_GLOBALHOOK)
+ if (data & MUTT_GLOBAL_HOOK)
{
/* Ignore duplicate global hooks */
if (mutt_str_strcmp(ptr->command, command.data) == 0)
else if (ptr->type == data &&
ptr->regex.not == not&&(mutt_str_strcmp(pattern.data, ptr->regex.pattern) == 0))
{
- if (data & (MUTT_FOLDERHOOK | MUTT_SENDHOOK | MUTT_SEND2HOOK | MUTT_MESSAGEHOOK |
- MUTT_ACCOUNTHOOK | MUTT_REPLYHOOK | MUTT_CRYPTHOOK |
- MUTT_TIMEOUTHOOK | MUTT_STARTUPHOOK | MUTT_SHUTDOWNHOOK))
+ if (data & (MUTT_FOLDER_HOOK | MUTT_SEND_HOOK | MUTT_SEND2_HOOK | MUTT_MESSAGE_HOOK |
+ MUTT_ACCOUNT_HOOK | MUTT_REPLY_HOOK | MUTT_CRYPT_HOOK |
+ MUTT_TIMEOUT_HOOK | MUTT_STARTUP_HOOK | MUTT_SHUTDOWN_HOOK))
{
/* these hooks allow multiple commands with the same
* pattern, so if we've already seen this pattern/command pair, just
}
}
- if (data & (MUTT_CHARSETHOOK | MUTT_ICONVHOOK))
+ if (data & (MUTT_CHARSET_HOOK | MUTT_ICONV_HOOK))
{
/* These are managed separately by the charset code */
- enum LookupType type = (data & MUTT_CHARSETHOOK) ? MUTT_LOOKUP_CHARSET : MUTT_LOOKUP_ICONV;
+ enum LookupType type = (data & MUTT_CHARSET_HOOK) ? MUTT_LOOKUP_CHARSET : MUTT_LOOKUP_ICONV;
if (!mutt_ch_lookup_add(type, pattern.data, command.data, err))
goto error;
FREE(&pattern.data);
FREE(&command.data);
return 0;
}
- else if (data & (MUTT_SENDHOOK | MUTT_SEND2HOOK | MUTT_SAVEHOOK |
- MUTT_FCCHOOK | MUTT_MESSAGEHOOK | MUTT_REPLYHOOK))
+ else if (data & (MUTT_SEND_HOOK | MUTT_SEND2_HOOK | MUTT_SAVE_HOOK |
+ MUTT_FCC_HOOK | MUTT_MESSAGE_HOOK | MUTT_REPLY_HOOK))
{
pat = mutt_pattern_comp(
pattern.data,
- (data & (MUTT_SENDHOOK | MUTT_SEND2HOOK | MUTT_FCCHOOK)) ? 0 : MUTT_FULL_MSG, err);
+ (data & (MUTT_SEND_HOOK | MUTT_SEND2_HOOK | MUTT_FCC_HOOK)) ? 0 : MUTT_FULL_MSG, err);
if (!pat)
goto error;
}
- else if (~data & MUTT_GLOBALHOOK) /* NOT a global hook */
+ else if (~data & MUTT_GLOBAL_HOOK) /* NOT a global hook */
{
/* Hooks not allowing full patterns: Check syntax of regex */
rx = mutt_mem_malloc(sizeof(regex_t));
- rc = REGCOMP(rx, NONULL(pattern.data), ((data & MUTT_CRYPTHOOK) ? REG_ICASE : 0));
+ rc = REGCOMP(rx, NONULL(pattern.data), ((data & MUTT_CRYPT_HOOK) ? REG_ICASE : 0));
if (rc != 0)
{
regerror(rc, rx, err->data, err->dsize);
return 0;
error:
- if (~data & MUTT_GLOBALHOOK) /* NOT a global hook */
+ if (~data & MUTT_GLOBAL_HOOK) /* NOT a global hook */
FREE(&pattern.data);
FREE(&command.data);
return -1;
/**
* mutt_delete_hooks - Delete matching hooks
- * @param type Hook type to delete, e.g. #MUTT_SENDHOOK
+ * @param type Hook type to delete, e.g. #MUTT_SEND_HOOK
*
* If 0 is passed, all the hooks will be deleted.
*/
mutt_buffer_printf(err, _("unhook: unknown hook type: %s"), buf->data);
return -1;
}
- if (type & (MUTT_CHARSETHOOK | MUTT_ICONVHOOK))
+ if (type & (MUTT_CHARSET_HOOK | MUTT_ICONV_HOOK))
{
mutt_ch_lookup_remove();
return 0;
struct Hook *tmp = NULL;
struct Buffer err, token;
- current_hook_type = MUTT_FOLDERHOOK;
+ current_hook_type = MUTT_FOLDER_HOOK;
mutt_buffer_init(&err);
err.dsize = STRING;
if (!tmp->command)
continue;
- if (tmp->type & MUTT_FOLDERHOOK)
+ if (tmp->type & MUTT_FOLDER_HOOK)
{
if ((regexec(tmp->regex.regex, path, 0, NULL, 0) == 0) ^ tmp->regex.not)
{
/**
* mutt_find_hook - Find a matching hook
- * @param type Type, e.g. #MUTT_FOLDERHOOK
+ * @param type Type, e.g. #MUTT_FOLDER_HOOK
* @param pat Pattern to match
* @retval ptr Command string
*
* mutt_message_hook - Perform a message hook
* @param ctx Mailbox Context
* @param hdr Email Header
- * @param type Hook type, e.g. #MUTT_MESSAGEHOOK
+ * @param type Hook type, e.g. #MUTT_MESSAGE_HOOK
*/
void mutt_message_hook(struct Context *ctx, struct Header *hdr, int type)
{
* addr_hook - Perform an address hook (get a path)
* @param path Buffer for path
* @param pathlen Length of buffer
- * @param type Type e.g. #MUTT_FCCHOOK
+ * @param type Type e.g. #MUTT_FCC_HOOK
* @param ctx Mailbox Context
* @param hdr Email Header
* @retval 0 Success
void mutt_default_save(char *path, size_t pathlen, struct Header *hdr)
{
*path = '\0';
- if (addr_hook(path, pathlen, MUTT_SAVEHOOK, Context, hdr) == 0)
+ if (addr_hook(path, pathlen, MUTT_SAVE_HOOK, Context, hdr) == 0)
return;
struct Address *addr = NULL;
*/
void mutt_select_fcc(char *path, size_t pathlen, struct Header *hdr)
{
- if (addr_hook(path, pathlen, MUTT_FCCHOOK, NULL, hdr) != 0)
+ if (addr_hook(path, pathlen, MUTT_FCC_HOOK, NULL, hdr) != 0)
{
struct Envelope *env = hdr->env;
if ((SaveName || ForceName) && (env->to || env->cc || env->bcc))
* list_hook - Find hook strings matching
* @param[out] matches List of hook strings
* @param[in] match String to match
- * @param[in] hook Hook type, e.g. #MUTT_CRYPTHOOK
+ * @param[in] hook Hook type, e.g. #MUTT_CRYPT_HOOK
*/
static void list_hook(struct ListHead *matches, const char *match, int hook)
{
*/
void mutt_crypt_hook(struct ListHead *list, struct Address *addr)
{
- list_hook(list, addr->mailbox, MUTT_CRYPTHOOK);
+ list_hook(list, addr->mailbox, MUTT_CRYPT_HOOK);
}
#ifdef USE_SOCKET
TAILQ_FOREACH(hook, &Hooks, entries)
{
- if (!(hook->command && (hook->type & MUTT_ACCOUNTHOOK)))
+ if (!(hook->command && (hook->type & MUTT_ACCOUNT_HOOK)))
continue;
if ((regexec(hook->regex.regex, url, 0, NULL, 0) == 0) ^ hook->regex.not)
TAILQ_FOREACH(hook, &Hooks, entries)
{
- if (!(hook->command && (hook->type & MUTT_TIMEOUTHOOK)))
+ if (!(hook->command && (hook->type & MUTT_TIMEOUT_HOOK)))
continue;
if (mutt_parse_rc_line(hook->command, &token, &err) == -1)
/**
* mutt_startup_shutdown_hook - Execute any startup/shutdown hooks
- * @param type Hook type: MUTT_STARTUPHOOK or MUTT_SHUTDOWNHOOK
+ * @param type Hook type: MUTT_STARTUP_HOOK or MUTT_SHUTDOWN_HOOK
*
* The user can configure hooks to be run on startup/shutdown.
* This function finds all the matching hooks and executes them.
extern bool SaveName;
/* types for mutt_parse_hook() */
-#define MUTT_FOLDERHOOK (1 << 0)
-#define MUTT_MBOXHOOK (1 << 1)
-#define MUTT_SENDHOOK (1 << 2)
-#define MUTT_FCCHOOK (1 << 3)
-#define MUTT_SAVEHOOK (1 << 4)
-#define MUTT_CHARSETHOOK (1 << 5)
-#define MUTT_ICONVHOOK (1 << 6)
-#define MUTT_MESSAGEHOOK (1 << 7)
-#define MUTT_CRYPTHOOK (1 << 8)
-#define MUTT_ACCOUNTHOOK (1 << 9)
-#define MUTT_REPLYHOOK (1 << 10)
-#define MUTT_SEND2HOOK (1 << 11)
+#define MUTT_FOLDER_HOOK (1 << 0)
+#define MUTT_MBOX_HOOK (1 << 1)
+#define MUTT_SEND_HOOK (1 << 2)
+#define MUTT_FCC_HOOK (1 << 3)
+#define MUTT_SAVE_HOOK (1 << 4)
+#define MUTT_CHARSET_HOOK (1 << 5)
+#define MUTT_ICONV_HOOK (1 << 6)
+#define MUTT_MESSAGE_HOOK (1 << 7)
+#define MUTT_CRYPT_HOOK (1 << 8)
+#define MUTT_ACCOUNT_HOOK (1 << 9)
+#define MUTT_REPLY_HOOK (1 << 10)
+#define MUTT_SEND2_HOOK (1 << 11)
#ifdef USE_COMPRESSED
-#define MUTT_OPENHOOK (1 << 12)
-#define MUTT_APPENDHOOK (1 << 13)
-#define MUTT_CLOSEHOOK (1 << 14)
+#define MUTT_OPEN_HOOK (1 << 12)
+#define MUTT_APPEND_HOOK (1 << 13)
+#define MUTT_CLOSE_HOOK (1 << 14)
#endif
-#define MUTT_TIMEOUTHOOK (1 << 15)
-#define MUTT_STARTUPHOOK (1 << 16)
-#define MUTT_SHUTDOWNHOOK (1 << 17)
-#define MUTT_GLOBALHOOK (1 << 18)
+#define MUTT_TIMEOUT_HOOK (1 << 15)
+#define MUTT_STARTUP_HOOK (1 << 16)
+#define MUTT_SHUTDOWN_HOOK (1 << 17)
+#define MUTT_GLOBAL_HOOK (1 << 18)
void mutt_account_hook(const char *url);
void mutt_crypt_hook(struct ListHead *list, struct Address *addr);
const struct Command Commands[] = {
#ifdef USE_SOCKET
- { "account-hook", mutt_parse_hook, MUTT_ACCOUNTHOOK },
+ { "account-hook", mutt_parse_hook, MUTT_ACCOUNT_HOOK },
#endif
{ "alias", parse_alias, 0 },
{ "alternates", parse_alternates, 0 },
{ "alternative_order", parse_stailq, UL &AlternativeOrderList },
#ifdef USE_COMPRESSED
- { "append-hook", mutt_parse_hook, MUTT_APPENDHOOK },
+ { "append-hook", mutt_parse_hook, MUTT_APPEND_HOOK },
#endif
{ "attachments", parse_attachments, 0 },
{ "auto_view", parse_stailq, UL &AutoViewList },
{ "bind", mutt_parse_bind, 0 },
- { "charset-hook", mutt_parse_hook, MUTT_CHARSETHOOK },
+ { "charset-hook", mutt_parse_hook, MUTT_CHARSET_HOOK },
#ifdef USE_COMPRESSED
- { "close-hook", mutt_parse_hook, MUTT_CLOSEHOOK },
+ { "close-hook", mutt_parse_hook, MUTT_CLOSE_HOOK },
#endif
#ifdef HAVE_COLOR
{ "color", mutt_parse_color, 0 },
#endif
- { "crypt-hook", mutt_parse_hook, MUTT_CRYPTHOOK },
+ { "crypt-hook", mutt_parse_hook, MUTT_CRYPT_HOOK },
{ "echo", parse_echo, 0 },
{ "exec", mutt_parse_exec, 0 },
- { "fcc-hook", mutt_parse_hook, MUTT_FCCHOOK },
- { "fcc-save-hook", mutt_parse_hook, MUTT_FCCHOOK | MUTT_SAVEHOOK },
+ { "fcc-hook", mutt_parse_hook, MUTT_FCC_HOOK },
+ { "fcc-save-hook", mutt_parse_hook, MUTT_FCC_HOOK | MUTT_SAVE_HOOK },
{ "finish", parse_finish, 0 },
- { "folder-hook", mutt_parse_hook, MUTT_FOLDERHOOK },
+ { "folder-hook", mutt_parse_hook, MUTT_FOLDER_HOOK },
{ "group", parse_group, MUTT_GROUP },
{ "hdr_order", parse_stailq, UL &HeaderOrderList },
- { "iconv-hook", mutt_parse_hook, MUTT_ICONVHOOK },
+ { "iconv-hook", mutt_parse_hook, MUTT_ICONV_HOOK },
{ "ifdef", parse_ifdef, 0 },
{ "ifndef", parse_ifdef, 1 },
{ "ignore", parse_ignore, 0 },
{ "macro", mutt_parse_macro, 0 },
{ "mailboxes", mutt_parse_mailboxes, 0 },
{ "mailto_allow", parse_stailq, UL &MailToAllow },
- { "mbox-hook", mutt_parse_hook, MUTT_MBOXHOOK },
- { "message-hook", mutt_parse_hook, MUTT_MESSAGEHOOK },
+ { "mbox-hook", mutt_parse_hook, MUTT_MBOX_HOOK },
+ { "message-hook", mutt_parse_hook, MUTT_MESSAGE_HOOK },
{ "mime_lookup", parse_stailq, UL &MimeLookupList },
{ "mono", mutt_parse_mono, 0 },
{ "my_hdr", parse_my_hdr, 0 },
{ "nospam", parse_spam_list, MUTT_NOSPAM },
#ifdef USE_COMPRESSED
- { "open-hook", mutt_parse_hook, MUTT_OPENHOOK },
+ { "open-hook", mutt_parse_hook, MUTT_OPEN_HOOK },
#endif
- { "pgp-hook", mutt_parse_hook, MUTT_CRYPTHOOK },
+ { "pgp-hook", mutt_parse_hook, MUTT_CRYPT_HOOK },
{ "push", mutt_parse_push, 0 },
- { "reply-hook", mutt_parse_hook, MUTT_REPLYHOOK },
+ { "reply-hook", mutt_parse_hook, MUTT_REPLY_HOOK },
{ "reset", parse_set, MUTT_SET_RESET },
- { "save-hook", mutt_parse_hook, MUTT_SAVEHOOK },
+ { "save-hook", mutt_parse_hook, MUTT_SAVE_HOOK },
{ "score", mutt_parse_score, 0 },
- { "send-hook", mutt_parse_hook, MUTT_SENDHOOK },
- { "send2-hook", mutt_parse_hook, MUTT_SEND2HOOK },
+ { "send-hook", mutt_parse_hook, MUTT_SEND_HOOK },
+ { "send2-hook", mutt_parse_hook, MUTT_SEND2_HOOK },
{ "set", parse_set, MUTT_SET_SET },
{ "setenv", parse_setenv, MUTT_SET_SET },
- { "shutdown-hook", mutt_parse_hook, MUTT_SHUTDOWNHOOK | MUTT_GLOBALHOOK },
+ { "shutdown-hook", mutt_parse_hook, MUTT_SHUTDOWN_HOOK | MUTT_GLOBAL_HOOK },
#ifdef USE_SIDEBAR
{ "sidebar_whitelist", parse_path_list, UL &SidebarWhitelist },
#endif
{ "source", parse_source, 0 },
{ "spam", parse_spam_list, MUTT_SPAM },
- { "startup-hook", mutt_parse_hook, MUTT_STARTUPHOOK | MUTT_GLOBALHOOK },
+ { "startup-hook", mutt_parse_hook, MUTT_STARTUP_HOOK | MUTT_GLOBAL_HOOK },
{ "subjectrx", parse_subjectrx_list, UL &SubjectRegexList },
{ "subscribe", parse_subscribe, 0 },
#ifdef USE_IMAP
#endif
{ "tag-formats", parse_tag_formats, 0 },
{ "tag-transforms", parse_tag_transforms, 0 },
- { "timeout-hook", mutt_parse_hook, MUTT_TIMEOUTHOOK | MUTT_GLOBALHOOK },
+ { "timeout-hook", mutt_parse_hook, MUTT_TIMEOUT_HOOK | MUTT_GLOBAL_HOOK },
{ "toggle", parse_set, MUTT_SET_INV },
{ "unalias", parse_unalias, 0 },
{ "unalternates", parse_unalternates, 0 },
}
mutt_folder_hook(folder);
- mutt_startup_shutdown_hook(MUTT_STARTUPHOOK);
+ mutt_startup_shutdown_hook(MUTT_STARTUP_HOOK);
repeat_error = true;
Context = mx_mbox_open(folder, ((flags & MUTT_RO) || ReadOnly) ? MUTT_READONLY : 0, NULL);
if (read_msgs && Move != MUTT_NO)
{
int is_spool;
- char *p = mutt_find_hook(MUTT_MBOXHOOK, ctx->path);
+ char *p = mutt_find_hook(MUTT_MBOX_HOOK, ctx->path);
if (p)
{
is_spool = 1;
/* make sure we have parsed this message */
mutt_parse_mime_message(Context, hdr);
- mutt_message_hook(Context, hdr, MUTT_MESSAGEHOOK);
+ mutt_message_hook(Context, hdr, MUTT_MESSAGE_HOOK);
struct Message *msg = mx_msg_open(Context, hdr->msgno);
if (!msg)
int chflags = CH_DECODE, cmflags = 0;
mutt_parse_mime_message(ctx, cur);
- mutt_message_hook(ctx, cur, MUTT_MESSAGEHOOK);
+ mutt_message_hook(ctx, cur, MUTT_MESSAGE_HOOK);
if ((WithCrypto != 0) && (cur->security & ENCRYPT) && ForwardDecode)
{
}
mutt_parse_mime_message(ctx, cur);
- mutt_message_hook(ctx, cur, MUTT_MESSAGEHOOK);
+ mutt_message_hook(ctx, cur, MUTT_MESSAGE_HOOK);
mutt_make_attribution(ctx, cur, out);
if ((flags & SENDREPLY) && cur)
{
/* change setting based upon message we are replying to */
- mutt_message_hook(ctx, cur, MUTT_REPLYHOOK);
+ mutt_message_hook(ctx, cur, MUTT_REPLY_HOOK);
/* set the replied flag for the message we are generating so that the
* user can use ~Q in a send-hook to know when reply-hook's are also
/* change settings based upon recipients */
- mutt_message_hook(NULL, msg, MUTT_SENDHOOK);
+ mutt_message_hook(NULL, msg, MUTT_SEND_HOOK);
/* Unset the replied flag from the message we are composing since it is
* no longer required. This is done here because the FCC'd copy of
* used for setting the editor, the sendmail path, or the
* envelope sender.
*/
- mutt_message_hook(NULL, msg, MUTT_SEND2HOOK);
+ mutt_message_hook(NULL, msg, MUTT_SEND2_HOOK);
/* wait until now to set the real name portion of our return address so
that $realname can be set in a send-hook */
rfc3676_space_stuff(msg);
}
- mutt_message_hook(NULL, msg, MUTT_SEND2HOOK);
+ mutt_message_hook(NULL, msg, MUTT_SEND2_HOOK);
}
if (!(flags & (SENDPOSTPONED | SENDFORWARD | SENDKEY | SENDRESEND | SENDDRAFTFILE)))