Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dmikushin/b5bd0c2542d36fc9f7d48ac1316444ed to your computer and use it in GitHub Desktop.
Save dmikushin/b5bd0c2542d36fc9f7d48ac1316444ed to your computer and use it in GitHub Desktop.
Make Alpine 2.21 to bounce all selected messages
From b4a79a41f995b27038011f92f0da3c6852a8596c Mon Sep 17 00:00:00 2001
From: Dmitry Mikushin <dmitry@kernelgen.org>
Date: Wed, 13 Sep 2017 03:28:26 +0300
Subject: [PATCH] Make Alpine 2.21 to bounce all selected messages
---
alpine/mailcmd.c | 5 -----
alpine/reply.c | 12 ++++++------
2 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/alpine/mailcmd.c b/alpine/mailcmd.c
index 85fe822..d3dbeae 100644
--- a/alpine/mailcmd.c
+++ b/alpine/mailcmd.c
@@ -2390,11 +2390,6 @@ cmd_bounce(struct pine *state, MSGNO_S *msgmap, int aopt, ACTION_S *role)
mn_m2raw(msgmap, mn_get_cur(msgmap)), MN_SLCT) == 0)
q_status_message(SM_ORDER | SM_DING, 3, 4,
_("WARNING: non-selected message is being bounced!"));
- else if (i > 1L
- && get_lflag(state->mail_stream, msgmap,
- mn_m2raw(msgmap, mn_get_cur(msgmap)), MN_SLCT))
- q_status_message(SM_ORDER | SM_DING, 3, 4,
- _("WARNING: not bouncing all selected messages!"));
rv = bounce(state, role);
diff --git a/alpine/reply.c b/alpine/reply.c
index 5851727..c9d62cf 100644
--- a/alpine/reply.c
+++ b/alpine/reply.c
@@ -1972,14 +1972,14 @@ bounce(struct pine *pine_state, ACTION_S *role)
dprint((4, "\n - bounce -\n"));
- if(mn_total_cur(pine_state->msgmap) > 1L){
+ if(mn_get_nmsgs(pine_state->msgmap) > 1L){
save_toptr = &save_to;
if(role)
snprintf(tmp_20k_buf, SIZEOF_20KBUF, _("BOUNCE (redirect) %ld messages (using role %s) to : "),
- mn_total_cur(pine_state->msgmap), role->nick);
+ mn_get_nmsgs(pine_state->msgmap), role->nick);
else
snprintf(tmp_20k_buf, SIZEOF_20KBUF, _("BOUNCE (redirect) %ld messages to : "),
- mn_total_cur(pine_state->msgmap));
+ mn_get_nmsgs(pine_state->msgmap));
tmp_20k_buf[SIZEOF_20KBUF-1] = '\0';
prmpt_who = cpystr(tmp_20k_buf);
snprintf(tmp_20k_buf, SIZEOF_20KBUF, _("Send %ld messages "),
@@ -1988,9 +1988,9 @@ bounce(struct pine *pine_state, ACTION_S *role)
prmpt_cnf = cpystr(tmp_20k_buf);
}
- for(msgno = mn_first_cur(pine_state->msgmap);
- msgno > 0L;
- msgno = mn_next_cur(pine_state->msgmap)){
+ for(msgno = 1;
+ msgno <= mn_get_nmsgs(pine_state->msgmap);
+ msgno++){
rawno = mn_m2raw(pine_state->msgmap, msgno);
if((env = pine_mail_fetchstructure(pine_state->mail_stream, rawno, NULL)) != NULL)
--
2.7.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment