[neomutt-devel] A Release is Coming!
наб
nabijaczleweli at nabijaczleweli.xyz
Fri Nov 3 15:56:15 CET 2023
On Sun, Sep 24, 2023 at 06:17:15PM +0200, наб wrote:
> On Thu, Sep 21, 2023 at 02:01:21PM +0100, Richard Russon wrote:
> > Please BUILD and TEST Neomutt. NOW!
> Still bb1d11e0af0de6673030c18f52eca10076d39d89:
> imap-fetch-mail no longer does it.
$ git bisect good
5af1898ee4bdad7169752b70abb90fd826ae5fe2 is the first bad commit
commit 5af1898ee4bdad7169752b70abb90fd826ae5fe2
Author: Richard Russon <rich at flatcap.org>
Date: Sat Sep 2 01:02:02 2023 +0100
limit mailbox checks
Now that the getch() timeout is 1 second, we need wait between mailbox checks.
mx.c | 10 ++++++++++
1 file changed, 10 insertions(+)
$ git show 5af1898ee4bdad7169752b70abb90fd826ae5fe2
commit 5af1898ee4bdad7169752b70abb90fd826ae5fe2
Author: Richard Russon (@flatcap) <rich at flatcap.org>
Date: Sat Sep 2 01:02:02 2023 +0100
limit mailbox checks
Now that the getch() timeout is 1 second, we need wait between mailbox checks.
diff --git a/mx.c b/mx.c
index d5225ada6..b4894f76f 100644
--- a/mx.c
+++ b/mx.c
@@ -79,6 +79,8 @@
#include <libintl.h>
#endif
+static time_t MailboxTime = 0; ///< last time we started checking for mail
+
/// Lookup table of mailbox types
static const struct Mapping MboxTypeMap[] = {
// clang-format off
@@ -1134,6 +1136,14 @@ enum MxStatus mx_mbox_check(struct Mailbox *m)
if (!m || !m->mx_ops)
return MX_STATUS_ERROR;
+ const short c_mail_check = cs_subset_number(NeoMutt->sub, "mail_check");
+
+ time_t t = mutt_date_now();
+ if ((t - MailboxTime) < c_mail_check)
+ return MX_STATUS_OK;
+
+ MailboxTime = t;
+
enum MxStatus rc = m->mx_ops->mbox_check(m);
if ((rc == MX_STATUS_NEW_MAIL) || (rc == MX_STATUS_REOPENED))
{
and resetting MailboxTime = 0 at the end of imap_check_mailbox()
fixes this; merge conflict with current HEAD revealed that this
also broke <shell-escape>, with a fresh and blessed function to
reset it (although why that funxion computes the point perfectly
before now instead of resetting to 0 is beyond me).
Scissor-patch using that funxion based on 20231103 below.
Best,
-- >8 --
Subject: [PATCH] force mail check on current mailbox after <imap-fetch-mail>
Mimicks commit 99ce265cb51b86b3b3eb704e1481853a714f3afa ("force mail
check on current mailbox after <shell-escape>")
Fixes: <otcypnzu2ejnxilir4hokqsqacm4mukjrqdnzepqyydmes7xfh at jcytte3ewb67>
---
imap/imap.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/imap/imap.c b/imap/imap.c
index 7a7fe93a8..5a5aaee47 100644
--- a/imap/imap.c
+++ b/imap/imap.c
@@ -1077,6 +1077,8 @@ enum MxStatus imap_check_mailbox(struct Mailbox *m, bool force)
mdata->check_status = IMAP_OPEN_NO_FLAGS;
+ if (force)
+ mx_mbox_reset_check();
return check;
}
--
2.39.2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://mailman.neomutt.org/pipermail/neomutt-devel-neomutt.org/attachments/20231103/a20a3d3d/attachment.sig>
More information about the neomutt-devel
mailing list