summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2021-12-03 21:20:37 -0700
committerEduardo Chappa <chappa@washington.edu>2021-12-03 21:20:37 -0700
commitb49234ede812f5860c6ed206603c28ee0d1b5917 (patch)
tree791041fa136db222722af1febea0c7a5bef8986e
parenta4717516707498544201c2e03286142c9abb2539 (diff)
downloadalpine-b49234ede812f5860c6ed206603c28ee0d1b5917.tar.xz
* If new mail has arrived when a user is closing a mailbox, Alpine will
also announce how many new messages have arrived. Suggested by Chime Hart.
-rw-r--r--alpine/alpine.c24
-rw-r--r--pith/pine.hlp8
2 files changed, 24 insertions, 8 deletions
diff --git a/alpine/alpine.c b/alpine/alpine.c
index 157c0958..7f4debe5 100644
--- a/alpine/alpine.c
+++ b/alpine/alpine.c
@@ -3234,12 +3234,24 @@ quit_screen(struct pine *pine_state)
if(F_ON(F_CHECK_MAIL_ONQUIT,ps_global)
&& pine_state->mail_stream != NULL
- && new_mail(1, VeryBadTime, NM_STATUS_MSG | NM_DEFER_SORT) > 0
- && (quit = want_to(_("Quit even though new mail just arrived"), 'y', 0,
- NO_HELP, WT_NORM | WT_DING)) != 'y'){
- refresh_sort(pine_state->mail_stream, pine_state->msgmap, SRT_VRB);
- pine_state->next_screen = pine_state->prev_screen;
- return;
+ && new_mail(1, VeryBadTime, NM_STATUS_MSG | NM_DEFER_SORT) > 0){
+ char *prompt = NULL;
+ if(sp_mail_since_cmd(pine_state->mail_stream) == 1)
+ prompt = cpystr(_("Quit even though 1 new mail just arrived"));
+ else if(sp_mail_since_cmd(pine_state->mail_stream) > 1){
+ snprintf(tmp_20k_buf, SIZEOF_20KBUF, _("Quit even though %lu new messages just arrived"), sp_mail_since_cmd(pine_state->mail_stream));
+ tmp_20k_buf[SIZEOF_20KBUF-1] = '\0';
+ prompt = cpystr(tmp_20k_buf);
+ }
+ else prompt = cpystr(_("Quit even though new mail just arrived"));
+ quit = want_to(prompt, 'y', 0, NO_HELP, WT_NORM | WT_DING);
+ if(prompt)
+ fs_give((void **) &prompt);
+ if(quit != 'y'){
+ refresh_sort(pine_state->mail_stream, pine_state->msgmap, SRT_VRB);
+ pine_state->next_screen = pine_state->prev_screen;
+ return;
+ }
}
if(quit != 'y'
diff --git a/pith/pine.hlp b/pith/pine.hlp
index 221ac505..94cc9da3 100644
--- a/pith/pine.hlp
+++ b/pith/pine.hlp
@@ -140,7 +140,7 @@ with help text for the config screen and the composer that didn't have any
reasonable place to be called from.
Dummy change to get revision in pine.hlp
============= h_revision =================
-Alpine Commit 628 2021-12-02 21:11:37
+Alpine Commit 629 2021-12-03 21:20:33
============= h_news =================
<HTML>
<HEAD>
@@ -183,7 +183,8 @@ it for you. Please take some time to read it and understand it.
Since the Privacy Policy could be amended to take into consideration
new additions to Alpine, please check it periodically.
-<P> Changes since the release of version <!--#echo var="ALPINE_VERSION"--> include:
+<P> Changes since the release of version 2.25 include:
+<!-- Changes since the release of version <!--#echo var="ALPINE_VERSION"--> include: -->
<P> New features include:
<UL>
@@ -230,6 +231,9 @@ new additions to Alpine, please check it periodically.
<LI> Add the LOGOUT command to the list of commands that can be
automatically interrupted in case the connection becomes unstable
during that command and Alpine times out its connection to the server.
+
+<LI> If new mail has arrived when a user is closing a mailbox, Alpine will
+ also announce how many new messages have arrived. Suggested by Chime Hart.
</UL>
<P>