break; \
}
-#define CURHDR Context->mailbox->emails[Context->mailbox->v2r[menu->current]]
-#define UNREAD(h) mutt_thread_contains_unread(Context, h)
-#define FLAGGED(h) mutt_thread_contains_flagged(Context, h)
+#define CUR_EMAIL Context->mailbox->emails[Context->mailbox->v2r[menu->current]]
+#define UNREAD(email) mutt_thread_contains_unread(Context, email)
+#define FLAGGED(email) mutt_thread_contains_flagged(Context, email)
-#define CAN_COLLAPSE(header) \
- ((CollapseUnread || !UNREAD(header)) && (CollapseFlagged || !FLAGGED(header)))
+#define CAN_COLLAPSE(email) \
+ ((CollapseUnread || !UNREAD(email)) && (CollapseFlagged || !FLAGGED(email)))
/**
* collapse_all - Collapse/uncollapse all threads
/* Figure out what the current message would be after folding / unfolding,
* so that we can restore the cursor in a sane way afterwards. */
- if (CURHDR->collapsed && toggle)
- final = mutt_uncollapse_thread(Context, CURHDR);
- else if (CAN_COLLAPSE(CURHDR))
- final = mutt_collapse_thread(Context, CURHDR);
+ if (CUR_EMAIL->collapsed && toggle)
+ final = mutt_uncollapse_thread(Context, CUR_EMAIL);
+ else if (CAN_COLLAPSE(CUR_EMAIL))
+ final = mutt_collapse_thread(Context, CUR_EMAIL);
else
- final = CURHDR->virtual;
+ final = CUR_EMAIL->virtual;
base = Context->mailbox->emails[Context->mailbox->v2r[final]];
*/
static void resort_index(struct Menu *menu)
{
- struct Email *current = CURHDR;
+ struct Email *current = CUR_EMAIL;
menu->current = -1;
mutt_sort_headers(Context, false);
index_hint = (Context->mailbox->vcount && menu->current >= 0 &&
menu->current < Context->mailbox->vcount) ?
- CURHDR->index :
+ CUR_EMAIL->index :
0;
check = mx_mbox_check(Context, &index_hint);
}
else
{
- if (STAILQ_EMPTY(&CURHDR->env->references))
+ if (STAILQ_EMPTY(&CUR_EMAIL->env->references))
{
mutt_error(_("Article has no parent reference"));
break;
}
- mutt_str_strfcpy(buf, STAILQ_FIRST(&CURHDR->env->references)->data,
+ mutt_str_strfcpy(buf, STAILQ_FIRST(&CUR_EMAIL->env->references)->data,
sizeof(buf));
}
if (!Context->mailbox->id_hash)
if (Context->mailbox->magic == MUTT_NNTP)
{
int oldmsgcount = Context->mailbox->msg_count;
- int oldindex = CURHDR->index;
+ int oldindex = CUR_EMAIL->index;
int rc2 = 0;
- if (!CURHDR->env->message_id)
+ if (!CUR_EMAIL->env->message_id)
{
mutt_error(_("No Message-Id. Unable to perform operation."));
break;
mutt_message(_("Fetching message headers..."));
if (!Context->mailbox->id_hash)
Context->mailbox->id_hash = mutt_make_id_hash(Context->mailbox);
- mutt_str_strfcpy(buf, CURHDR->env->message_id, sizeof(buf));
+ mutt_str_strfcpy(buf, CUR_EMAIL->env->message_id, sizeof(buf));
/* trying to find msgid of the root message */
if (op == OP_RECONSTRUCT_THREAD)
{
struct ListNode *ref = NULL;
- STAILQ_FOREACH(ref, &CURHDR->env->references, entries)
+ STAILQ_FOREACH(ref, &CUR_EMAIL->env->references, entries)
{
if (!mutt_hash_find(Context->mailbox->id_hash, ref->data))
{
/* at least one message has been loaded */
if (Context->mailbox->msg_count > oldmsgcount)
{
- struct Email *oldcur = CURHDR;
+ struct Email *oldcur = CUR_EMAIL;
struct Email *e = NULL;
bool quiet = Context->mailbox->quiet;
CHECK_IN_MAILBOX;
menu->oldcurrent = (Context->mailbox->vcount && menu->current >= 0 &&
menu->current < Context->mailbox->vcount) ?
- CURHDR->index :
+ CUR_EMAIL->index :
-1;
if (op == OP_TOGGLE_READ)
{
mutt_pattern_func(MUTT_LIMIT, NULL);
}
- if (((op == OP_LIMIT_CURRENT_THREAD) && mutt_limit_current_thread(CURHDR)) ||
+ if (((op == OP_LIMIT_CURRENT_THREAD) && mutt_limit_current_thread(CUR_EMAIL)) ||
(op == OP_TOGGLE_READ) ||
((op == OP_MAIN_LIMIT) &&
(mutt_pattern_func(MUTT_LIMIT,
}
else
{
- mutt_set_flag(Context->mailbox, CURHDR, MUTT_TAG, !CURHDR->tagged);
+ mutt_set_flag(Context->mailbox, CUR_EMAIL, MUTT_TAG, !CUR_EMAIL->tagged);
- Context->last_tag = CURHDR->tagged ?
- CURHDR :
- ((Context->last_tag == CURHDR && !CURHDR->tagged) ?
+ Context->last_tag = CUR_EMAIL->tagged ?
+ CUR_EMAIL :
+ ((Context->last_tag == CUR_EMAIL && !CUR_EMAIL->tagged) ?
NULL :
Context->last_tag);
CHECK_ATTACH;
CHECK_MSGCOUNT;
CHECK_VISIBLE;
- ci_send_message(SEND_TO_SENDER, NULL, NULL, Context, tag ? NULL : CURHDR);
+ ci_send_message(SEND_TO_SENDER, NULL, NULL, Context, tag ? NULL : CUR_EMAIL);
menu->redraw = REDRAW_FULL;
break;
/* threads may be reordered, so figure out what header the cursor
* should be on. #3092 */
int newidx = menu->current;
- if (CURHDR->deleted)
+ if (CUR_EMAIL->deleted)
newidx = ci_next_undeleted(menu->current);
if (newidx < 0)
newidx = ci_previous_undeleted(menu->current);
}
else
{
- CURHDR->quasi_deleted = true;
+ CUR_EMAIL->quasi_deleted = true;
Context->mailbox->changed = true;
}
break;
{
if (!Context || (Context->mailbox->magic != MUTT_NOTMUCH))
{
- if (!CURHDR || !CURHDR->env || !CURHDR->env->message_id)
+ if (!CUR_EMAIL || !CUR_EMAIL->env || !CUR_EMAIL->env->message_id)
{
mutt_message(_("No virtual folder and no Message-Id, aborting"));
break;
} // no virtual folder, but we have message-id, reconstruct thread on-the-fly
strncpy(buf, "id:", sizeof(buf));
int msg_id_offset = 0;
- if ((CURHDR->env->message_id)[0] == '<')
+ if ((CUR_EMAIL->env->message_id)[0] == '<')
msg_id_offset = 1;
- mutt_str_strcat(buf, sizeof(buf), (CURHDR->env->message_id) + msg_id_offset);
+ mutt_str_strcat(buf, sizeof(buf), (CUR_EMAIL->env->message_id) + msg_id_offset);
if (buf[strlen(buf) - 1] == '>')
buf[strlen(buf) - 1] = '\0';
if (!nm_uri_from_query(Context->mailbox, buf, sizeof(buf)))
CHECK_MSGCOUNT;
CHECK_VISIBLE;
int oc = Context->mailbox->msg_count;
- if (nm_read_entire_thread(Context, CURHDR) < 0)
+ if (nm_read_entire_thread(Context, CUR_EMAIL) < 0)
{
mutt_message(_("Failed to read thread, aborting"));
break;
}
if (oc < Context->mailbox->msg_count)
{
- struct Email *oldcur = CURHDR;
+ struct Email *oldcur = CUR_EMAIL;
if ((Sort & SORT_MASK) == SORT_THREADS)
mutt_sort_headers(Context, false);
if (oldcur->collapsed || Context->collapsed)
{
- menu->current = mutt_uncollapse_thread(Context, CURHDR);
+ menu->current = mutt_uncollapse_thread(Context, CUR_EMAIL);
mutt_set_virtual(Context);
}
}
CHECK_READONLY;
char *tags = NULL;
if (!tag)
- tags = driver_tags_get_with_hidden(&CURHDR->tags);
+ tags = driver_tags_get_with_hidden(&CUR_EMAIL->tags);
rc = mx_tags_edit(Context->mailbox, tags, buf, sizeof(buf));
FREE(&tags);
if (rc < 0)
}
else
{
- if (mx_tags_commit(Context->mailbox, CURHDR, buf))
+ if (mx_tags_commit(Context->mailbox, CUR_EMAIL, buf))
{
mutt_message(_("Failed to modify tags, aborting"));
break;
bool still_queried = false;
#ifdef USE_NOTMUCH
if (Context->mailbox->magic == MUTT_NOTMUCH)
- still_queried = nm_message_is_still_queried(Context->mailbox, CURHDR);
+ still_queried = nm_message_is_still_queried(Context->mailbox, CUR_EMAIL);
#endif
- CURHDR->quasi_deleted = !still_queried;
+ CUR_EMAIL->quasi_deleted = !still_queried;
Context->mailbox->changed = true;
}
if (menu->menu == MENU_PAGER)
OptNeedResort = false;
- if ((Sort & SORT_MASK) == SORT_THREADS && CURHDR->collapsed)
+ if ((Sort & SORT_MASK) == SORT_THREADS && CUR_EMAIL->collapsed)
{
- mutt_uncollapse_thread(Context, CURHDR);
+ mutt_uncollapse_thread(Context, CUR_EMAIL);
mutt_set_virtual(Context);
if (UncollapseJump)
- menu->current = mutt_thread_next_unread(Context, CURHDR);
+ menu->current = mutt_thread_next_unread(Context, CUR_EMAIL);
}
- if (PgpAutoDecode && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
+ if (PgpAutoDecode && (tag || !(CUR_EMAIL->security & PGP_TRADITIONAL_CHECKED)))
{
- mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw);
+ mutt_check_traditional_pgp(tag ? NULL : CUR_EMAIL, &menu->redraw);
}
int hint =
Context->mailbox->emails[Context->mailbox->v2r[menu->current]]->index;
* set CurrentMenu incorrectly when we return back to the index menu. */
menu->menu = MENU_MAIN;
- op = mutt_display_message(CURHDR);
+ op = mutt_display_message(CUR_EMAIL);
if (op < 0)
{
OptNeedResort = false;
if ((Sort & SORT_MASK) != SORT_THREADS)
mutt_error(_("Threading is not enabled"));
- else if (!STAILQ_EMPTY(&CURHDR->env->in_reply_to) ||
- !STAILQ_EMPTY(&CURHDR->env->references))
+ else if (!STAILQ_EMPTY(&CUR_EMAIL->env->in_reply_to) ||
+ !STAILQ_EMPTY(&CUR_EMAIL->env->references))
{
{
- struct Email *oldcur = CURHDR;
+ struct Email *oldcur = CUR_EMAIL;
- mutt_break_thread(CURHDR);
+ mutt_break_thread(CUR_EMAIL);
mutt_sort_headers(Context, true);
menu->current = oldcur->virtual;
}
if ((Sort & SORT_MASK) != SORT_THREADS)
mutt_error(_("Threading is not enabled"));
- else if (!CURHDR->env->message_id)
+ else if (!CUR_EMAIL->env->message_id)
mutt_error(_("No Message-ID: header available to link thread"));
else if (!tag && (!Context->last_tag || !Context->last_tag->tagged))
mutt_error(_("First, please tag a message to be linked here"));
else
{
- struct Email *oldcur = CURHDR;
+ struct Email *oldcur = CUR_EMAIL;
- if (mutt_link_threads(CURHDR, tag ? NULL : Context->last_tag, Context))
+ if (mutt_link_threads(CUR_EMAIL, tag ? NULL : Context->last_tag, Context))
{
mutt_sort_headers(Context, true);
menu->current = oldcur->virtual;
CHECK_MSGCOUNT;
CHECK_VISIBLE;
CHECK_ATTACH;
- mutt_edit_content_type(CURHDR, CURHDR->content, NULL);
+ mutt_edit_content_type(CUR_EMAIL, CUR_EMAIL->content, NULL);
/* if we were in the pager, redisplay the message */
if (menu->menu == MENU_PAGER)
{
case OP_DECODE_SAVE:
CHECK_MSGCOUNT;
CHECK_VISIBLE;
- if ((mutt_save_message(tag ? NULL : CURHDR,
+ if ((mutt_save_message(tag ? NULL : CUR_EMAIL,
(op == OP_DECRYPT_SAVE) || (op == OP_SAVE) || (op == OP_DECODE_SAVE),
(op == OP_DECODE_SAVE) || (op == OP_DECODE_COPY),
(op == OP_DECRYPT_SAVE) || (op == OP_DECRYPT_COPY)) == 0) &&
}
else
{
- mutt_set_flag(Context->mailbox, CURHDR, MUTT_FLAG, !CURHDR->flagged);
+ mutt_set_flag(Context->mailbox, CUR_EMAIL, MUTT_FLAG, !CUR_EMAIL->flagged);
if (Resolve)
{
menu->current = ci_next_undeleted(menu->current);
}
else
{
- if (CURHDR->read || CURHDR->old)
- mutt_set_flag(Context->mailbox, CURHDR, MUTT_NEW, 1);
+ if (CUR_EMAIL->read || CUR_EMAIL->old)
+ mutt_set_flag(Context->mailbox, CUR_EMAIL, MUTT_NEW, 1);
else
- mutt_set_flag(Context->mailbox, CURHDR, MUTT_READ, 1);
+ mutt_set_flag(Context->mailbox, CUR_EMAIL, MUTT_READ, 1);
if (Resolve)
{
switch (op)
{
case OP_MAIN_NEXT_THREAD:
- menu->current = mutt_next_thread(CURHDR);
+ menu->current = mutt_next_thread(CUR_EMAIL);
break;
case OP_MAIN_NEXT_SUBTHREAD:
- menu->current = mutt_next_subthread(CURHDR);
+ menu->current = mutt_next_subthread(CUR_EMAIL);
break;
case OP_MAIN_PREV_THREAD:
- menu->current = mutt_previous_thread(CURHDR);
+ menu->current = mutt_previous_thread(CUR_EMAIL);
break;
case OP_MAIN_PREV_SUBTHREAD:
- menu->current = mutt_previous_subthread(CURHDR);
+ menu->current = mutt_previous_subthread(CUR_EMAIL);
break;
}
CHECK_MSGCOUNT;
CHECK_VISIBLE;
- menu->current = mutt_parent_message(Context, CURHDR, op == OP_MAIN_ROOT_MESSAGE);
+ menu->current = mutt_parent_message(Context, CUR_EMAIL, op == OP_MAIN_ROOT_MESSAGE);
if (menu->current < 0)
{
menu->current = menu->oldcurrent;
CHECK_READONLY;
/* CHECK_ACL(MUTT_ACL_WRITE); */
- if (mutt_change_flag(tag ? NULL : CURHDR, (op == OP_MAIN_SET_FLAG)) == 0)
+ if (mutt_change_flag(tag ? NULL : CUR_EMAIL, (op == OP_MAIN_SET_FLAG)) == 0)
{
menu->redraw |= REDRAW_STATUS;
if (tag)
break;
}
- if (CURHDR->collapsed)
+ if (CUR_EMAIL->collapsed)
{
- menu->current = mutt_uncollapse_thread(Context, CURHDR);
+ menu->current = mutt_uncollapse_thread(Context, CUR_EMAIL);
mutt_set_virtual(Context);
if (UncollapseJump)
- menu->current = mutt_thread_next_unread(Context, CURHDR);
+ menu->current = mutt_thread_next_unread(Context, CUR_EMAIL);
}
- else if (CAN_COLLAPSE(CURHDR))
+ else if (CAN_COLLAPSE(CUR_EMAIL))
{
- menu->current = mutt_collapse_thread(Context, CURHDR);
+ menu->current = mutt_collapse_thread(Context, CUR_EMAIL);
mutt_set_virtual(Context);
}
else
CHECK_ATTACH;
CHECK_MSGCOUNT;
CHECK_VISIBLE;
- ci_bounce_message(tag ? NULL : CURHDR);
+ ci_bounce_message(tag ? NULL : CUR_EMAIL);
break;
case OP_CREATE_ALIAS:
- mutt_alias_create(Context && Context->mailbox->vcount ? CURHDR->env : NULL, NULL);
+ mutt_alias_create(Context && Context->mailbox->vcount ? CUR_EMAIL->env : NULL, NULL);
menu->redraw |= REDRAW_CURRENT;
break;
}
else
{
- mutt_set_flag(Context->mailbox, CURHDR, MUTT_DELETE, 1);
- mutt_set_flag(Context->mailbox, CURHDR, MUTT_PURGE, (op == OP_PURGE_MESSAGE));
+ mutt_set_flag(Context->mailbox, CUR_EMAIL, MUTT_DELETE, 1);
+ mutt_set_flag(Context->mailbox, CUR_EMAIL, MUTT_PURGE, (op == OP_PURGE_MESSAGE));
if (DeleteUntag)
- mutt_set_flag(Context->mailbox, CURHDR, MUTT_TAG, 0);
+ mutt_set_flag(Context->mailbox, CUR_EMAIL, MUTT_TAG, 0);
if (Resolve)
{
menu->current = ci_next_undeleted(menu->current);
{
int subthread = (op == OP_DELETE_SUBTHREAD);
- rc = mutt_thread_set_flag(CURHDR, MUTT_DELETE, 1, subthread);
+ rc = mutt_thread_set_flag(CUR_EMAIL, MUTT_DELETE, 1, subthread);
if (rc == -1)
break;
if (op == OP_PURGE_THREAD)
{
- rc = mutt_thread_set_flag(CURHDR, MUTT_PURGE, 1, subthread);
+ rc = mutt_thread_set_flag(CUR_EMAIL, MUTT_PURGE, 1, subthread);
if (rc == -1)
break;
}
if (DeleteUntag)
- mutt_thread_set_flag(CURHDR, MUTT_TAG, 0, subthread);
+ mutt_thread_set_flag(CUR_EMAIL, MUTT_TAG, 0, subthread);
if (Resolve)
{
menu->current = ci_next_undeleted(menu->current);
CHECK_MSGCOUNT;
CHECK_VISIBLE;
- mutt_display_address(CURHDR->env);
+ mutt_display_address(CUR_EMAIL->env);
break;
case OP_ENTER_COMMAND:
else
edit = false;
- if (PgpAutoDecode && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
+ if (PgpAutoDecode && (tag || !(CUR_EMAIL->security & PGP_TRADITIONAL_CHECKED)))
{
- mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw);
+ mutt_check_traditional_pgp(tag ? NULL : CUR_EMAIL, &menu->redraw);
}
if (edit)
- mutt_edit_message(Context, tag ? NULL : CURHDR);
+ mutt_edit_message(Context, tag ? NULL : CUR_EMAIL);
else
- mutt_view_message(Context, tag ? NULL : CURHDR);
+ mutt_view_message(Context, tag ? NULL : CUR_EMAIL);
menu->redraw = REDRAW_FULL;
break;
CHECK_MSGCOUNT;
CHECK_VISIBLE;
CHECK_ATTACH;
- if (PgpAutoDecode && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
+ if (PgpAutoDecode && (tag || !(CUR_EMAIL->security & PGP_TRADITIONAL_CHECKED)))
{
- mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw);
+ mutt_check_traditional_pgp(tag ? NULL : CUR_EMAIL, &menu->redraw);
}
- ci_send_message(SEND_FORWARD, NULL, NULL, Context, tag ? NULL : CURHDR);
+ ci_send_message(SEND_FORWARD, NULL, NULL, Context, tag ? NULL : CUR_EMAIL);
menu->redraw = REDRAW_FULL;
break;
CHECK_MSGCOUNT;
CHECK_VISIBLE;
CHECK_ATTACH;
- if (PgpAutoDecode && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
+ if (PgpAutoDecode && (tag || !(CUR_EMAIL->security & PGP_TRADITIONAL_CHECKED)))
{
- mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw);
+ mutt_check_traditional_pgp(tag ? NULL : CUR_EMAIL, &menu->redraw);
}
ci_send_message(SEND_REPLY | SEND_GROUP_REPLY, NULL, NULL, Context,
- tag ? NULL : CURHDR);
+ tag ? NULL : CUR_EMAIL);
menu->redraw = REDRAW_FULL;
break;
CHECK_MSGCOUNT;
CHECK_VISIBLE;
CHECK_READONLY;
- rc = mutt_label_message(tag ? NULL : CURHDR);
+ rc = mutt_label_message(tag ? NULL : CUR_EMAIL);
if (rc > 0)
{
Context->mailbox->changed = true;
CHECK_ATTACH;
CHECK_MSGCOUNT;
CHECK_VISIBLE;
- if (PgpAutoDecode && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
+ if (PgpAutoDecode && (tag || !(CUR_EMAIL->security & PGP_TRADITIONAL_CHECKED)))
{
- mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw);
+ mutt_check_traditional_pgp(tag ? NULL : CUR_EMAIL, &menu->redraw);
}
ci_send_message(SEND_REPLY | SEND_LIST_REPLY, NULL, NULL, Context,
- tag ? NULL : CURHDR);
+ tag ? NULL : CUR_EMAIL);
menu->redraw = REDRAW_FULL;
break;
break;
CHECK_MSGCOUNT;
CHECK_VISIBLE;
- crypt_extract_keys_from_messages(tag ? NULL : CURHDR);
+ crypt_extract_keys_from_messages(tag ? NULL : CUR_EMAIL);
menu->redraw = REDRAW_FULL;
break;
break;
CHECK_MSGCOUNT;
CHECK_VISIBLE;
- if (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))
- mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw);
+ if (tag || !(CUR_EMAIL->security & PGP_TRADITIONAL_CHECKED))
+ mutt_check_traditional_pgp(tag ? NULL : CUR_EMAIL, &menu->redraw);
if (menu->menu == MENU_PAGER)
{
CHECK_MSGCOUNT;
CHECK_VISIBLE;
- mutt_pipe_message(tag ? NULL : CURHDR);
+ mutt_pipe_message(tag ? NULL : CUR_EMAIL);
#ifdef USE_IMAP
/* in an IMAP folder index with imap_peek=no, piping could change
CHECK_MSGCOUNT;
CHECK_VISIBLE;
- mutt_print_message(tag ? NULL : CURHDR);
+ mutt_print_message(tag ? NULL : CUR_EMAIL);
#ifdef USE_IMAP
/* in an IMAP folder index with imap_peek=no, printing could change
*/
CHECK_ACL(MUTT_ACL_SEEN, _("Cannot mark messages as read"));
- rc = mutt_thread_set_flag(CURHDR, MUTT_READ, 1, op == OP_MAIN_READ_THREAD ? 0 : 1);
+ rc = mutt_thread_set_flag(CUR_EMAIL, MUTT_READ, 1, op == OP_MAIN_READ_THREAD ? 0 : 1);
if (rc != -1)
{
if (Resolve)
{
- menu->current = (op == OP_MAIN_READ_THREAD ? mutt_next_thread(CURHDR) :
- mutt_next_subthread(CURHDR));
+ menu->current = (op == OP_MAIN_READ_THREAD ? mutt_next_thread(CUR_EMAIL) :
+ mutt_next_subthread(CUR_EMAIL));
if (menu->current == -1)
{
menu->current = menu->oldcurrent;
CHECK_MSGCOUNT;
CHECK_VISIBLE;
- if (CURHDR->env->message_id)
+ if (CUR_EMAIL->env->message_id)
{
char buf2[128];
{
char str[STRING], macro[STRING];
snprintf(str, sizeof(str), "%s%s", MarkMacroPrefix, buf2);
- snprintf(macro, sizeof(macro), "<search>~i \"%s\"\n", CURHDR->env->message_id);
+ snprintf(macro, sizeof(macro), "<search>~i \"%s\"\n", CUR_EMAIL->env->message_id);
/* L10N: "message hotkey" is the key bindings menu description of a
macro created by <mark-message>. */
km_bind(str, MENU_MAIN, OP_MACRO, macro, _("message hotkey"));
}
}
else
- mutt_resend_message(NULL, Context, CURHDR);
+ mutt_resend_message(NULL, Context, CUR_EMAIL);
menu->redraw = REDRAW_FULL;
break;
case OP_POST:
CHECK_ATTACH;
- if (op != OP_FOLLOWUP || !CURHDR->env->followup_to ||
- (mutt_str_strcasecmp(CURHDR->env->followup_to, "poster") != 0) ||
+ if (op != OP_FOLLOWUP || !CUR_EMAIL->env->followup_to ||
+ (mutt_str_strcasecmp(CUR_EMAIL->env->followup_to, "poster") != 0) ||
query_quadoption(FollowupToPoster,
_("Reply by mail as poster prefers?")) != MUTT_YES)
{
{
CHECK_MSGCOUNT;
ci_send_message((op == OP_FOLLOWUP ? SEND_REPLY : SEND_FORWARD) | SEND_NEWS,
- NULL, NULL, Context, tag ? NULL : CURHDR);
+ NULL, NULL, Context, tag ? NULL : CUR_EMAIL);
}
menu->redraw = REDRAW_FULL;
break;
CHECK_ATTACH;
CHECK_MSGCOUNT;
CHECK_VISIBLE;
- if (PgpAutoDecode && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
+ if (PgpAutoDecode && (tag || !(CUR_EMAIL->security & PGP_TRADITIONAL_CHECKED)))
{
- mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw);
+ mutt_check_traditional_pgp(tag ? NULL : CUR_EMAIL, &menu->redraw);
}
- ci_send_message(SEND_REPLY, NULL, NULL, Context, tag ? NULL : CURHDR);
+ ci_send_message(SEND_REPLY, NULL, NULL, Context, tag ? NULL : CUR_EMAIL);
menu->redraw = REDRAW_FULL;
break;
CHECK_MSGCOUNT;
CHECK_VISIBLE;
- rc = mutt_thread_set_flag(CURHDR, MUTT_TAG, !CURHDR->tagged,
+ rc = mutt_thread_set_flag(CUR_EMAIL, MUTT_TAG, !CUR_EMAIL->tagged,
op == OP_TAG_THREAD ? 0 : 1);
if (rc != -1)
if (Resolve)
{
if (op == OP_TAG_THREAD)
- menu->current = mutt_next_thread(CURHDR);
+ menu->current = mutt_next_thread(CUR_EMAIL);
else
- menu->current = mutt_next_subthread(CURHDR);
+ menu->current = mutt_next_subthread(CUR_EMAIL);
if (menu->current == -1)
menu->current = menu->oldcurrent;
}
else
{
- mutt_set_flag(Context->mailbox, CURHDR, MUTT_DELETE, 0);
- mutt_set_flag(Context->mailbox, CURHDR, MUTT_PURGE, 0);
+ mutt_set_flag(Context->mailbox, CUR_EMAIL, MUTT_DELETE, 0);
+ mutt_set_flag(Context->mailbox, CUR_EMAIL, MUTT_PURGE, 0);
if (Resolve && menu->current < Context->mailbox->vcount - 1)
{
menu->current++;
*/
CHECK_ACL(MUTT_ACL_DELETE, _("Cannot undelete messages"));
- rc = mutt_thread_set_flag(CURHDR, MUTT_DELETE, 0, op == OP_UNDELETE_THREAD ? 0 : 1);
+ rc = mutt_thread_set_flag(CUR_EMAIL, MUTT_DELETE, 0, op == OP_UNDELETE_THREAD ? 0 : 1);
if (rc != -1)
{
- rc = mutt_thread_set_flag(CURHDR, MUTT_PURGE, 0,
+ rc = mutt_thread_set_flag(CUR_EMAIL, MUTT_PURGE, 0,
op == OP_UNDELETE_THREAD ? 0 : 1);
}
if (rc != -1)
if (Resolve)
{
if (op == OP_UNDELETE_THREAD)
- menu->current = mutt_next_thread(CURHDR);
+ menu->current = mutt_next_thread(CUR_EMAIL);
else
- menu->current = mutt_next_subthread(CURHDR);
+ menu->current = mutt_next_subthread(CUR_EMAIL);
if (menu->current == -1)
menu->current = menu->oldcurrent;
case OP_VIEW_ATTACHMENTS:
CHECK_MSGCOUNT;
CHECK_VISIBLE;
- mutt_view_attachments(CURHDR);
- if (Context && CURHDR->attach_del)
+ mutt_view_attachments(CUR_EMAIL);
+ if (Context && CUR_EMAIL->attach_del)
Context->mailbox->changed = true;
menu->redraw = REDRAW_FULL;
break;
#define IsAttach(x) (x && (x)->bdy)
#define IsMsgAttach(x) (x && (x)->fp && (x)->bdy && (x)->bdy->email)
-#define IsHeader(x) (x && (x)->email && !(x)->bdy)
+#define IsEmail(x) (x && (x)->email && !(x)->bdy)
static const char *Not_available_in_this_menu =
N_("Not available in this menu");
move(0, 0);
clrtobot();
- if (IsHeader(rd->extra) && Context && ((Context->mailbox->vcount + 1) < PagerIndexLines))
+ if (IsEmail(rd->extra) && Context && ((Context->mailbox->vcount + 1) < PagerIndexLines))
rd->indexlen = Context->mailbox->vcount + 1;
else
rd->indexlen = PagerIndexLines;
rd->index_status_window->rows = 0;
rd->index_window->rows = 0;
- if (IsHeader(rd->extra) && PagerIndexLines)
+ if (IsEmail(rd->extra) && PagerIndexLines)
{
memcpy(rd->index_window, MuttIndexWindow, sizeof(struct MuttWindow));
rd->index_window->rows = rd->indexlen > 0 ? rd->indexlen - 1 : 0;
FREE(&Resize);
}
- if (IsHeader(rd->extra) && PagerIndexLines)
+ if (IsEmail(rd->extra) && PagerIndexLines)
{
if (!rd->index)
{
mutt_window_move(rd->pager_status_window, 0, 0);
SETCOLOR(MT_COLOR_STATUS);
- if (IsHeader(rd->extra) || IsMsgAttach(rd->extra))
+ if (IsEmail(rd->extra) || IsMsgAttach(rd->extra))
{
size_t l1 = rd->pager_status_window->cols * MB_LEN_MAX;
size_t l2 = sizeof(buffer);
- hfi.email = (IsHeader(rd->extra)) ? rd->extra->email : rd->extra->bdy->email;
+ hfi.email = (IsEmail(rd->extra)) ? rd->extra->email : rd->extra->bdy->email;
mutt_make_string_info(buffer, l1 < l2 ? l1 : l2, rd->pager_status_window->cols,
NONULL(PagerFormat), &hfi, MUTT_FORMAT_MAKEPRINT);
mutt_draw_statusline(rd->pager_status_window->cols, buffer, l2);
rd.indicator = rd.indexlen / 3;
rd.helpstr = helpstr;
rd.searchbuf = searchbuf;
- rd.has_types = (IsHeader(extra) || (flags & MUTT_SHOWCOLOR)) ? MUTT_TYPES : 0; /* main message or rfc822 attachment */
+ rd.has_types = (IsEmail(extra) || (flags & MUTT_SHOWCOLOR)) ? MUTT_TYPES : 0; /* main message or rfc822 attachment */
rd.fp = fopen(fname, "r");
if (!rd.fp)
/* Initialize variables */
- if (Context && IsHeader(extra) && !extra->email->read)
+ if (Context && IsEmail(extra) && !extra->email->read)
{
Context->msgnotreadyet = extra->email->msgno;
mutt_set_flag(Context->mailbox, extra->email, MUTT_READ, 1);
}
mutt_compile_help(helpstr, sizeof(helpstr), MENU_PAGER, PagerHelp);
- if (IsHeader(extra))
+ if (IsEmail(extra))
{
mutt_str_strfcpy(tmphelp, helpstr, sizeof(tmphelp));
mutt_compile_help(buffer, sizeof(buffer), MENU_PAGER,
mutt_refresh();
- if (IsHeader(extra) && OldHdr == extra->email && TopLine != rd.topline &&
+ if (IsEmail(extra) && OldHdr == extra->email && TopLine != rd.topline &&
rd.line_info[rd.curline].offset < rd.sb.st_size - 1)
{
if (TopLine - rd.topline > rd.lines)
case OP_SORT:
case OP_SORT_REVERSE:
- CHECK_MODE(IsHeader(extra))
+ CHECK_MODE(IsEmail(extra))
if (mutt_select_sort((ch == OP_SORT_REVERSE)) == 0)
{
OptNeedResort = true;
*/
case OP_BOUNCE_MESSAGE:
- CHECK_MODE(IsHeader(extra) || IsMsgAttach(extra))
+ CHECK_MODE(IsEmail(extra) || IsMsgAttach(extra))
CHECK_ATTACH;
if (IsMsgAttach(extra))
mutt_attach_bounce(extra->fp, extra->actx, extra->bdy);
break;
case OP_RESEND:
- CHECK_MODE(IsHeader(extra) || IsMsgAttach(extra))
+ CHECK_MODE(IsEmail(extra) || IsMsgAttach(extra))
CHECK_ATTACH;
if (IsMsgAttach(extra))
mutt_attach_resend(extra->fp, extra->actx, extra->bdy);
break;
case OP_COMPOSE_TO_SENDER:
- CHECK_MODE(IsHeader(extra) || IsMsgAttach(extra));
+ CHECK_MODE(IsEmail(extra) || IsMsgAttach(extra));
CHECK_ATTACH;
if (IsMsgAttach(extra))
mutt_attach_mail_sender(extra->fp, extra->email, extra->actx, extra->bdy);
break;
case OP_CHECK_TRADITIONAL:
- CHECK_MODE(IsHeader(extra));
+ CHECK_MODE(IsEmail(extra));
if (!(WithCrypto & APPLICATION_PGP))
break;
if (!(extra->email->security & PGP_TRADITIONAL_CHECKED))
break;
case OP_CREATE_ALIAS:
- CHECK_MODE(IsHeader(extra) || IsMsgAttach(extra));
+ CHECK_MODE(IsEmail(extra) || IsMsgAttach(extra));
if (IsMsgAttach(extra))
mutt_alias_create(extra->bdy->email->env, NULL);
else
case OP_PURGE_MESSAGE:
case OP_DELETE:
- CHECK_MODE(IsHeader(extra));
+ CHECK_MODE(IsEmail(extra));
CHECK_READONLY;
/* L10N: CHECK_ACL */
CHECK_ACL(MUTT_ACL_DELETE, _("Cannot delete message"));
case OP_MAIN_SET_FLAG:
case OP_MAIN_CLEAR_FLAG:
- CHECK_MODE(IsHeader(extra));
+ CHECK_MODE(IsEmail(extra));
CHECK_READONLY;
if (mutt_change_flag(extra->email, (ch == OP_MAIN_SET_FLAG)) == 0)
case OP_DELETE_THREAD:
case OP_DELETE_SUBTHREAD:
case OP_PURGE_THREAD:
- CHECK_MODE(IsHeader(extra));
+ CHECK_MODE(IsEmail(extra));
CHECK_READONLY;
/* L10N: CHECK_ACL */
/* L10N: Due to the implementation details we do not know whether we
break;
case OP_DISPLAY_ADDRESS:
- CHECK_MODE(IsHeader(extra) || IsMsgAttach(extra));
+ CHECK_MODE(IsEmail(extra) || IsMsgAttach(extra));
if (IsMsgAttach(extra))
mutt_display_address(extra->bdy->email->env);
else
if (OptNeedResort)
{
OptNeedResort = false;
- CHECK_MODE(IsHeader(extra));
+ CHECK_MODE(IsEmail(extra));
OptNeedResort = true;
}
break;
case OP_FLAG_MESSAGE:
- CHECK_MODE(IsHeader(extra));
+ CHECK_MODE(IsEmail(extra));
CHECK_READONLY;
/* L10N: CHECK_ACL */
CHECK_ACL(MUTT_ACL_WRITE, "Cannot flag message");
break;
case OP_PIPE:
- CHECK_MODE(IsHeader(extra) || IsAttach(extra));
+ CHECK_MODE(IsEmail(extra) || IsAttach(extra));
if (IsAttach(extra))
mutt_pipe_attachment_list(extra->actx, extra->fp, false, extra->bdy, false);
else
break;
case OP_PRINT:
- CHECK_MODE(IsHeader(extra) || IsAttach(extra));
+ CHECK_MODE(IsEmail(extra) || IsAttach(extra));
if (IsAttach(extra))
mutt_print_attachment_list(extra->actx, extra->fp, false, extra->bdy);
else
break;
case OP_MAIL:
- CHECK_MODE(IsHeader(extra) && !IsAttach(extra));
+ CHECK_MODE(IsEmail(extra) && !IsAttach(extra));
CHECK_ATTACH;
ci_send_message(0, NULL, NULL, extra->ctx, NULL);
pager_menu->redraw = REDRAW_FULL;
#ifdef USE_NNTP
case OP_POST:
- CHECK_MODE(IsHeader(extra) && !IsAttach(extra));
+ CHECK_MODE(IsEmail(extra) && !IsAttach(extra));
CHECK_ATTACH;
if (extra->ctx && extra->ctx->mailbox->magic == MUTT_NNTP &&
!((struct NntpMboxData *) extra->ctx->mailbox->mdata)->allowed && query_quadoption(PostModerated, _("Posting to this group not allowed, may be moderated. Continue?")) != MUTT_YES)
break;
case OP_FORWARD_TO_GROUP:
- CHECK_MODE(IsHeader(extra) || IsMsgAttach(extra));
+ CHECK_MODE(IsEmail(extra) || IsMsgAttach(extra));
CHECK_ATTACH;
if (extra->ctx && extra->ctx->mailbox->magic == MUTT_NNTP &&
!((struct NntpMboxData *) extra->ctx->mailbox->mdata)->allowed && query_quadoption(PostModerated, _("Posting to this group not allowed, may be moderated. Continue?")) != MUTT_YES)
break;
case OP_FOLLOWUP:
- CHECK_MODE(IsHeader(extra) || IsMsgAttach(extra));
+ CHECK_MODE(IsEmail(extra) || IsMsgAttach(extra));
CHECK_ATTACH;
if (IsMsgAttach(extra))
#endif
/* fallthrough */
case OP_REPLY:
- CHECK_MODE(IsHeader(extra) || IsMsgAttach(extra));
+ CHECK_MODE(IsEmail(extra) || IsMsgAttach(extra));
CHECK_ATTACH;
if (IsMsgAttach(extra))
mutt_attach_reply(extra->fp, extra->email, extra->actx, extra->bdy, SEND_REPLY);
break;
case OP_RECALL_MESSAGE:
- CHECK_MODE(IsHeader(extra) && !IsAttach(extra));
+ CHECK_MODE(IsEmail(extra) && !IsAttach(extra));
CHECK_ATTACH;
ci_send_message(SEND_POSTPONED, NULL, NULL, extra->ctx, extra->email);
pager_menu->redraw = REDRAW_FULL;
break;
case OP_GROUP_REPLY:
- CHECK_MODE(IsHeader(extra) || IsMsgAttach(extra));
+ CHECK_MODE(IsEmail(extra) || IsMsgAttach(extra));
CHECK_ATTACH;
if (IsMsgAttach(extra))
{
break;
case OP_LIST_REPLY:
- CHECK_MODE(IsHeader(extra) || IsMsgAttach(extra));
+ CHECK_MODE(IsEmail(extra) || IsMsgAttach(extra));
CHECK_ATTACH;
if (IsMsgAttach(extra))
{
break;
case OP_FORWARD_MESSAGE:
- CHECK_MODE(IsHeader(extra) || IsMsgAttach(extra));
+ CHECK_MODE(IsEmail(extra) || IsMsgAttach(extra));
CHECK_ATTACH;
if (IsMsgAttach(extra))
mutt_attach_forward(extra->fp, extra->email, extra->actx, extra->bdy, 0);
ch = -1;
break;
}
- CHECK_MODE(IsHeader(extra));
+ CHECK_MODE(IsEmail(extra));
if ((mutt_save_message(
extra->email, (ch == OP_DECRYPT_SAVE) || (ch == OP_SAVE) || (ch == OP_DECODE_SAVE),
(ch == OP_DECODE_SAVE) || (ch == OP_DECODE_COPY),
break;
case OP_TAG:
- CHECK_MODE(IsHeader(extra));
+ CHECK_MODE(IsEmail(extra));
if (Context)
{
mutt_set_flag(Context->mailbox, extra->email, MUTT_TAG, !extra->email->tagged);
break;
case OP_TOGGLE_NEW:
- CHECK_MODE(IsHeader(extra));
+ CHECK_MODE(IsEmail(extra));
CHECK_READONLY;
/* L10N: CHECK_ACL */
CHECK_ACL(MUTT_ACL_SEEN, _("Cannot toggle new"));
break;
case OP_UNDELETE:
- CHECK_MODE(IsHeader(extra));
+ CHECK_MODE(IsEmail(extra));
CHECK_READONLY;
/* L10N: CHECK_ACL */
CHECK_ACL(MUTT_ACL_DELETE, _("Cannot undelete message"));
case OP_UNDELETE_THREAD:
case OP_UNDELETE_SUBTHREAD:
- CHECK_MODE(IsHeader(extra));
+ CHECK_MODE(IsEmail(extra));
CHECK_READONLY;
/* L10N: CHECK_ACL */
/* L10N: Due to the implementation details we do not know whether we
rc = OP_ATTACH_COLLAPSE;
break;
}
- CHECK_MODE(IsHeader(extra));
+ CHECK_MODE(IsEmail(extra));
mutt_view_attachments(extra->email);
if (Context && extra->email->attach_del)
Context->mailbox->changed = true;
ch = -1;
break;
}
- CHECK_MODE(IsHeader(extra));
+ CHECK_MODE(IsEmail(extra));
CHECK_ATTACH;
ci_send_message(SEND_KEY, NULL, NULL, extra->ctx, extra->email);
pager_menu->redraw = REDRAW_FULL;
break;
case OP_EDIT_LABEL:
- CHECK_MODE(IsHeader(extra));
+ CHECK_MODE(IsEmail(extra));
rc = mutt_label_message(extra->email);
if (rc > 0)
{
ch = -1;
break;
}
- CHECK_MODE(IsHeader(extra));
+ CHECK_MODE(IsEmail(extra));
crypt_extract_keys_from_messages(extra->email);
pager_menu->redraw = REDRAW_FULL;
break;
}
mutt_file_fclose(&rd.fp);
- if (IsHeader(extra))
+ if (IsEmail(extra))
{
if (Context)
Context->msgnotreadyet = -1;