summaryrefslogtreecommitdiffstats
path: root/buffy.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>1999-09-12 07:45:30 +0000
committerThomas Roessler <roessler@does-not-exist.org>1999-09-12 07:45:30 +0000
commit97bae0db181796555344b5d751020e2b9250d606 (patch)
treef94eb80e11e63f16ec896a3d92ab1d9e9a26db19 /buffy.c
parent6d0ed4409462de9f9ec88d12497995223f586505 (diff)
The attached patch (imap-turbocharge.diff):
* changes mutt_buffy_check to only poll the selected folder when it is opened, not all mailboxes (unless the timeout has expired). This is a noticeable win if you have a few IMAP mailboxes. * sets the default checkinterval to 60 seconds from 0. Things are much much slower with 0. * makes some cosmetic renames * moves lots of generic imap stuff into a separate file, imap/util.c * abstracts the process of sending a command to an IMAP server a bit better (lots more to do here, though). * moves the message-set creation code used by the new fastdelete code into its own function, since it is generally useful. * implements server-side copy of messages. Tagged messages are copied in one command, thanks to the message-set function. Speedy! (From: Brendan Cully; modifications by tlr.)
Diffstat (limited to 'buffy.c')
-rw-r--r--buffy.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/buffy.c b/buffy.c
index fa3baeed..c22a316c 100644
--- a/buffy.c
+++ b/buffy.c
@@ -232,10 +232,10 @@ int mutt_buffy_check (int force)
static time_t last_imap_check = 0;
int do_imap_check = 1;
- if (ImapCheckTime)
+ if (ImapCheckTimeout)
{
time_t now = time (NULL);
- if (!force && (now - last_imap_check < ImapCheckTime))
+ if (now - last_imap_check < ImapCheckTimeout)
do_imap_check = 0;
else
last_imap_check = now;
@@ -348,11 +348,14 @@ int mutt_buffy_check (int force)
#ifdef USE_IMAP
case M_IMAP:
- /* poll on do_imap_check, else return cached value */
- if (do_imap_check)
+ /* poll on do_imap_check, else return cached value.
+ * If the check is forced (eg on mailbox open), check only current
+ * folder */
+ if (do_imap_check || (force && !mutt_strcmp (Context->path,
+ tmp->path)))
{
tmp->new = 0;
- if (imap_buffy_check (tmp->path) > 0)
+ if (imap_mailbox_check (tmp->path, 1) > 0)
{
BuffyCount++;
tmp->new = 1;