summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--OPS1
-rw-r--r--curs_main.c6
-rw-r--r--functions.h6
-rw-r--r--globals.h4
-rw-r--r--imap/imap.c5
5 files changed, 19 insertions, 3 deletions
diff --git a/OPS b/OPS
index b4d39a5b..9ed55ce5 100644
--- a/OPS
+++ b/OPS
@@ -97,6 +97,7 @@ OP_MAIN_CHANGE_FOLDER "open a different folder"
OP_MAIN_CHANGE_FOLDER_READONLY "open a different folder in read only mode"
OP_MAIN_CLEAR_FLAG "clear a status flag from a message"
OP_MAIN_DELETE_PATTERN "delete messages matching a pattern"
+OP_MAIN_IMAP_FETCH "force retrieval of mail from IMAP server"
OP_MAIN_FETCH_MAIL "retrieve mail from POP server"
OP_MAIN_FIRST_MESSAGE "move to the first message"
OP_MAIN_LAST_MESSAGE "move to the last message"
diff --git a/curs_main.c b/curs_main.c
index 6e6816a5..f4972783 100644
--- a/curs_main.c
+++ b/curs_main.c
@@ -876,6 +876,12 @@ int mutt_index_menu (void)
* The following operations can be performed inside of the pager.
*/
+#ifdef USE_IMAP
+ case OP_MAIN_IMAP_FETCH:
+ ImapLastCheck = 0;
+ break;
+#endif
+
case OP_MAIN_SYNC_FOLDER:
CHECK_MSGCOUNT;
diff --git a/functions.h b/functions.h
index 3b1bd8ec..0f2f1e59 100644
--- a/functions.h
+++ b/functions.h
@@ -85,6 +85,9 @@ struct binding_t OpMain[] = {
#ifdef USE_POP
{ "fetch-mail", OP_MAIN_FETCH_MAIL, "G" },
#endif
+#ifdef USE_IMAP
+ { "imap-fetch-mail", OP_MAIN_IMAP_FETCH, NULL },
+#endif
{ "display-toggle-weed", OP_DISPLAY_HEADERS, "h" },
{ "next-undeleted", OP_MAIN_NEXT_UNDELETED, "j" },
{ "previous-undeleted", OP_MAIN_PREV_UNDELETED, "k" },
@@ -160,6 +163,9 @@ struct binding_t OpPager[] = {
{ "forward-message", OP_FORWARD_MESSAGE, "f" },
{ "flag-message", OP_FLAG_MESSAGE, "F" },
{ "group-reply", OP_GROUP_REPLY, "g" },
+#ifdef USE_IMAP
+ { "imap-fetch-mail", OP_MAIN_IMAP_FETCH, NULL },
+#endif
{ "display-toggle-weed", OP_DISPLAY_HEADERS, "h" },
{ "next-undeleted", OP_MAIN_NEXT_UNDELETED, "j" },
{ "next-entry", OP_NEXT_ENTRY, "J" },
diff --git a/globals.h b/globals.h
index 936b8b9e..45691a1e 100644
--- a/globals.h
+++ b/globals.h
@@ -111,6 +111,10 @@ WHERE LIST *UnIgnore INITVAL(0);
WHERE LIST *MailLists INITVAL(0);
WHERE LIST *SubscribedLists INITVAL(0);
+#ifdef USE_IMAP
+WHERE time_t ImapLastCheck INITVAL(0);
+#endif
+
/* bit vector for boolean variables */
#ifdef MAIN_C
unsigned char Options[(OPTMAX + 7)/8];
diff --git a/imap/imap.c b/imap/imap.c
index 4f7913eb..3302e91b 100644
--- a/imap/imap.c
+++ b/imap/imap.c
@@ -1008,7 +1008,6 @@ int imap_check_mailbox (CONTEXT *ctx, int *index_hint)
{
/* overload keyboard timeout to avoid many mailbox checks in a row.
* Most users don't like having to wait exactly when they press a key. */
- static time_t LastCheck = 0;
IMAP_DATA* idata;
time_t now;
@@ -1016,8 +1015,8 @@ int imap_check_mailbox (CONTEXT *ctx, int *index_hint)
idata = (IMAP_DATA*) ctx->data;
now = time(NULL);
- if (now > LastCheck + Timeout) {
- LastCheck = now;
+ if (now > ImapLastCheck + Timeout) {
+ ImapLastCheck = now;
if (imap_exec (idata, "NOOP", 0) != 0)
{