break;
case OP_COMPOSE_EDIT_FROM:
menu->redraw = edit_address_list (HDR_FROM, &msg->env->from);
+ mutt_message_hook (NULL, msg, M_SEND2HOOK);
break;
case OP_COMPOSE_EDIT_TO:
menu->redraw = edit_address_list (HDR_TO, &msg->env->to);
- break;
+ mutt_message_hook (NULL, msg, M_SEND2HOOK);
+ break;
case OP_COMPOSE_EDIT_BCC:
menu->redraw = edit_address_list (HDR_BCC, &msg->env->bcc);
+ mutt_message_hook (NULL, msg, M_SEND2HOOK);
break;
case OP_COMPOSE_EDIT_CC:
menu->redraw = edit_address_list (HDR_CC, &msg->env->cc);
- break;
+ mutt_message_hook (NULL, msg, M_SEND2HOOK);
+ break;
case OP_COMPOSE_EDIT_SUBJECT:
if (msg->env->subject)
strfcpy (buf, msg->env->subject, sizeof (buf));
if (msg->env->subject)
mutt_paddstr (W, msg->env->subject);
}
- break;
+ mutt_message_hook (NULL, msg, M_SEND2HOOK);
+ break;
case OP_COMPOSE_EDIT_REPLY_TO:
menu->redraw = edit_address_list (HDR_REPLYTO, &msg->env->reply_to);
+ mutt_message_hook (NULL, msg, M_SEND2HOOK);
break;
case OP_COMPOSE_EDIT_FCC:
strfcpy (buf, fcc, sizeof (buf));
fccSet = 1;
}
MAYBE_REDRAW (menu->redraw);
- break;
+ mutt_message_hook (NULL, msg, M_SEND2HOOK);
+ break;
case OP_COMPOSE_EDIT_MESSAGE:
if (Editor && (mutt_strcmp ("builtin", Editor) != 0) && !option (OPTEDITHDRS))
{
mutt_edit_file (Editor, msg->content->filename);
mutt_update_encoding (msg->content);
menu->redraw = REDRAW_CURRENT | REDRAW_STATUS;
+ mutt_message_hook (NULL, msg, M_SEND2HOOK);
break;
}
/* fall through */
menu->max = idxlen;
}
- menu->redraw = REDRAW_FULL;
+ menu->redraw = REDRAW_FULL;
+ mutt_message_hook (NULL, msg, M_SEND2HOOK);
break;
unset_option(OPTNEEDREDRAW);
}
- break;
+ mutt_message_hook (NULL, msg, M_SEND2HOOK);
+ break;
case OP_COMPOSE_ATTACH_FILE:
menu->redraw |= REDRAW_INDEX | REDRAW_STATUS;
}
- break;
+ mutt_message_hook (NULL, msg, M_SEND2HOOK);
+ break;
case OP_COMPOSE_ATTACH_MESSAGE:
{
Sort = oldSort;
SortAux = oldSortAux;
}
- break;
+ mutt_message_hook (NULL, msg, M_SEND2HOOK);
+ break;
case OP_DELETE:
CHECK_COUNT;
msg->content = idx[0]->content;
menu->redraw |= REDRAW_STATUS;
- break;
+ mutt_message_hook (NULL, msg, M_SEND2HOOK);
+ break;
#define CURRENT idx[menu->current]->content
else
mutt_message (_("The current attachment will be converted."));
menu->redraw = REDRAW_CURRENT;
+ mutt_message_hook (NULL, msg, M_SEND2HOOK);
break;
}
#undef CURRENT
mutt_str_replace (&idx[menu->current]->content->description, buf);
menu->redraw = REDRAW_CURRENT;
}
- break;
+ mutt_message_hook (NULL, msg, M_SEND2HOOK);
+ break;
case OP_COMPOSE_UPDATE_ENCODING:
CHECK_COUNT;
mutt_update_encoding(idx[menu->current]->content);
menu->redraw = REDRAW_CURRENT | REDRAW_STATUS;
}
+ mutt_message_hook (NULL, msg, M_SEND2HOOK);
break;
case OP_COMPOSE_TOGGLE_DISPOSITION:
menu->redraw = REDRAW_CURRENT;
}
- break;
+ mutt_message_hook (NULL, msg, M_SEND2HOOK);
+ break;
case OP_COMPOSE_EDIT_ENCODING:
CHECK_COUNT;
else
mutt_error _("Invalid encoding.");
}
- break;
+ mutt_message_hook (NULL, msg, M_SEND2HOOK);
+ break;
case OP_COMPOSE_SEND_MESSAGE:
+
+ /* Note: We don't invoke send2-hook here, since we want to leave
+ * users an opportunity to change settings from the ":" prompt.
+ */
if(check_attachments(idx, idxlen) != 0)
{
mutt_edit_file (NONULL(Editor), idx[menu->current]->content->filename);
mutt_update_encoding (idx[menu->current]->content);
menu->redraw = REDRAW_CURRENT | REDRAW_STATUS;
+ mutt_message_hook (NULL, msg, M_SEND2HOOK);
break;
case OP_COMPOSE_TOGGLE_UNLINK:
menu->current++;
# endif
menu->redraw = REDRAW_INDEX;
+ /* No send2hook since this doesn't change the message. */
break;
case OP_COMPOSE_GET_ATTACHMENT:
else if (mutt_get_tmp_attachment(idx[menu->current]->content) == 0)
menu->redraw = REDRAW_CURRENT;
+ /* No send2hook since this doesn't change the message. */
break;
case OP_COMPOSE_RENAME_FILE:
mutt_stamp_attachment(idx[menu->current]->content);
}
- break;
+ mutt_message_hook (NULL, msg, M_SEND2HOOK);
+ break;
case OP_COMPOSE_NEW_MIME:
{
menu->redraw = REDRAW_FULL;
}
}
- break;
+ mutt_message_hook (NULL, msg, M_SEND2HOOK);
+ break;
case OP_COMPOSE_EDIT_MIME:
CHECK_COUNT;
mutt_update_encoding (idx[menu->current]->content);
menu->redraw = REDRAW_FULL;
}
- break;
+ mutt_message_hook (NULL, msg, M_SEND2HOOK);
+ break;
case OP_VIEW_ATTACH:
case OP_DISPLAY_HEADERS:
CHECK_COUNT;
mutt_attach_display_loop (menu, op, NULL, NULL, NULL, &idx, &idxlen, NULL, 0);
menu->redraw = REDRAW_FULL;
+ /* no send2hook, since this doesn't modify the message */
break;
case OP_SAVE:
CHECK_COUNT;
mutt_save_attachment_list (NULL, menu->tagprefix, menu->tagprefix ? msg->content : idx[menu->current]->content, NULL, menu);
MAYBE_REDRAW (menu->redraw);
+ /* no send2hook, since this doesn't modify the message */
break;
case OP_PRINT:
CHECK_COUNT;
mutt_print_attachment_list (NULL, menu->tagprefix, menu->tagprefix ? msg->content : idx[menu->current]->content);
+ /* no send2hook, since this doesn't modify the message */
break;
case OP_PIPE:
CHECK_COUNT;
mutt_pipe_attachment_list (NULL, menu->tagprefix, menu->tagprefix ? msg->content : idx[menu->current]->content, op == OP_FILTER);
if (op == OP_FILTER) /* cte might have changed */
- menu->redraw = menu->tagprefix ? REDRAW_FULL : REDRAW_CURRENT;
+ menu->redraw = menu->tagprefix ? REDRAW_FULL : REDRAW_CURRENT;
menu->redraw |= REDRAW_STATUS;
+ mutt_message_hook (NULL, msg, M_SEND2HOOK);
break;
case OP_EXIT:
}
msg->security = crypt_pgp_send_menu (msg, &menu->redraw);
redraw_crypt_lines (msg);
- break;
+ mutt_message_hook (NULL, msg, M_SEND2HOOK);
+ break;
case OP_FORGET_PASSPHRASE:
}
msg->security = crypt_smime_send_menu(msg, &menu->redraw);
redraw_crypt_lines (msg);
- break;
+ mutt_message_hook (NULL, msg, M_SEND2HOOK);
+ break;
#ifdef MIXMASTER
case OP_COMPOSE_MIX:
mix_make_chain (&msg->chain, &menu->redraw);
+ mutt_message_hook (NULL, msg, M_SEND2HOOK);
break;
#endif
return 0;
}
+static void _alternates_clean (void)
+{
+ int i;
+ if (Context && Context->msgcount)
+ {
+ for (i = 0; i < Context->msgcount; i++)
+ Context->hdrs[i]->recip_valid = 0;
+ }
+}
+
+static int parse_alternates (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err)
+{
+ _alternates_clean();
+ return parse_rx_list (buf, s, data, err);
+}
+
+static int parse_unalternates (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err)
+{
+ _alternates_clean();
+ return parse_rx_unlist (buf, s, data, err);
+}
+
static int parse_spam_list (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err)
{
BUFFER templ;
pp->rx = safe_calloc (1, sizeof (regex_t));
pp->pattern = safe_strdup ((char *) p->init);
- if (mutt_strcmp (p->option, "alternates") == 0)
- flags |= REG_ICASE;
- else if (mutt_strcmp (p->option, "mask") != 0)
+ if (mutt_strcmp (p->option, "mask") != 0)
flags |= mutt_which_case ((const char *) p->init);
if (mutt_strcmp (p->option, "mask") == 0 && *s == '!')
{
break;
}
- if (option(OPTATTACHMSG) && (!mutt_strcmp(MuttVars[idx].option, "alternates")
- || !mutt_strcmp(MuttVars[idx].option, "reply_regexp")))
+ if (option(OPTATTACHMSG) && !mutt_strcmp(MuttVars[idx].option, "reply_regexp"))
{
snprintf (err->data, err->dsize, "Operation not permitted when in attach-message mode.");
r = -1;
{
int not = 0;
- /* $alternates is case-insensitive,
- $mask is case-sensitive */
- if (mutt_strcmp (MuttVars[idx].option, "alternates") == 0)
- flags |= REG_ICASE;
- else if (mutt_strcmp (MuttVars[idx].option, "mask") != 0)
+ /* $mask is case-sensitive */
+ if (mutt_strcmp (MuttVars[idx].option, "mask") != 0)
flags |= mutt_which_case (tmp->data);
p = tmp->data;
}
#undef CUR_ENV
}
-
- if(Context && Context->msgcount &&
- mutt_strcmp(MuttVars[idx].option, "alternates") == 0)
- {
- int i;
-
- for(i = 0; i < Context->msgcount; i++)
- Context->hdrs[i]->recip_valid = 0;
- }
}
}
else if (DTYPE(MuttVars[idx].type) == DT_MAGIC)
static int parse_unmy_hdr (BUFFER *, BUFFER *, unsigned long, BUFFER *);
static int parse_subscribe (BUFFER *, BUFFER *, unsigned long, BUFFER *);
+static int parse_alternates (BUFFER *, BUFFER *, unsigned long, BUFFER *);
+static int parse_unalternates (BUFFER *, BUFFER *, unsigned long, BUFFER *);
+
struct command_t
{
char *name;
};
struct command_t Commands[] = {
- { "alternates", parse_rx_list, UL &Alternates },
- { "unalternates", parse_rx_unlist, UL &Alternates },
+ { "alternates", parse_alternates, UL &Alternates },
+ { "unalternates", parse_unalternates, UL &Alternates },
#ifdef USE_SOCKET
{ "account-hook", mutt_parse_hook, M_ACCOUNTHOOK },
#endif
{ "save-hook", mutt_parse_hook, M_SAVEHOOK },
{ "score", mutt_parse_score, 0 },
{ "send-hook", mutt_parse_hook, M_SENDHOOK },
+ { "send2-hook", mutt_parse_hook, M_SEND2HOOK },
{ "set", parse_set, 0 },
{ "source", parse_source, 0 },
{ "spam", parse_spam_list, M_SPAM },