diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 1999-09-12 07:45:30 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 1999-09-12 07:45:30 +0000 |
commit | 97bae0db181796555344b5d751020e2b9250d606 (patch) | |
tree | f94eb80e11e63f16ec896a3d92ab1d9e9a26db19 /buffy.c | |
parent | 6d0ed4409462de9f9ec88d12497995223f586505 (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.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -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; |