/**
* mutt_ev_message - Edit or view a message
- * @param ctx Mailbox Context
- * @param e Email
+ * @param m Mailbox
+ * @param el List of Emails
* @param action Action to perform, e.g. #EVM_EDIT
* @retval 1 Message not modified
* @retval 0 Message edited successfully
* @retval -1 Error
*/
-int mutt_ev_message(struct Context *ctx, struct Email *e, enum EvMessage action)
+int mutt_ev_message(struct Mailbox *m, struct EmailList *el, enum EvMessage action)
{
- if (e)
- return ev_message(action, ctx->mailbox, e);
-
- for (int i = 0; i < ctx->mailbox->msg_count; i++)
+ struct EmailNode *en = NULL;
+ STAILQ_FOREACH(en, el, entries)
{
- if (!message_is_tagged(ctx, i))
- continue;
-
- if (ev_message(action, ctx->mailbox, ctx->mailbox->emails[i]) == -1)
+ if (ev_message(action, m, en->email) == -1)
return -1;
}
case OP_EDIT_OR_VIEW_RAW_MESSAGE:
case OP_EDIT_RAW_MESSAGE:
case OP_VIEW_RAW_MESSAGE:
-
+ {
/* TODO split this into 3 cases? */
CHECK_MSGCOUNT;
CHECK_VISIBLE;
{
mutt_check_traditional_pgp(tag ? NULL : CUR_EMAIL, &menu->redraw);
}
- mutt_ev_message(Context, tag ? NULL : CUR_EMAIL, edit ? EVM_EDIT : EVM_VIEW);
+ struct EmailList el = STAILQ_HEAD_INITIALIZER(el);
+ el_add_tagged(&el, Context, CUR_EMAIL, tag);
+ mutt_ev_message(Context->mailbox, &el, edit ? EVM_EDIT : EVM_VIEW);
+ el_free(&el);
menu->redraw = REDRAW_FULL;
break;
+ }
case OP_FORWARD_MESSAGE:
struct EnterState;
struct Envelope;
struct Email;
+struct EmailList;
struct Mailbox;
/**
EVM_EDIT, ///< Edit the message
};
-int mutt_ev_message(struct Context *ctx, struct Email *e, enum EvMessage action);
+int mutt_ev_message(struct Mailbox *m, struct EmailList *el, enum EvMessage action);
int mutt_system(const char *cmd);