From 25cdeb8f967766afc4b75b3f7ea7e34719308471 Mon Sep 17 00:00:00 2001 From: Rocco Rutte Date: Sun, 26 Apr 2009 21:09:53 +0200 Subject: [PATCH] POP: Support hcache updating, too. This also allows us to use hcache to manage "flagged" and "replied" message flags. --- UPDATING | 2 ++ doc/manual.xml.head | 10 ++++++++++ pop.c | 13 +++++++++++++ 3 files changed, 25 insertions(+) diff --git a/UPDATING b/UPDATING index 6f0f1994d..0e34d4028 100644 --- a/UPDATING +++ b/UPDATING @@ -5,6 +5,8 @@ The keys used are: !: modified feature, -: deleted feature, +: new feature hg tip: + + the "flagged" and "replied" flags are enabled/supported for + POP when built with header caching + and work in the pager, too + ~x pattern also matches against In-Reply-To + lower case patterns for string searches perform case-insensitive diff --git a/doc/manual.xml.head b/doc/manual.xml.head index d65cf7e4c..13d46d3fe 100644 --- a/doc/manual.xml.head +++ b/doc/manual.xml.head @@ -6760,6 +6760,16 @@ controlled by the variable, which defaults to every 60 seconds. + +POP is read-only which doesn't allow for some features like editing +messages or changing flags. However, using + and +Mutt simulates the new/old/read flags as well as flagged and replied. +Mutt applies some logic on top of remote messages but cannot change +the messages itself so that modifications of flags are lost when +messages are downloaded from the POP server. + + Another way to access your POP3 mail is the <fetch-mail> function diff --git a/pop.c b/pop.c index 674064535..1768e614a 100644 --- a/pop.c +++ b/pop.c @@ -418,6 +418,11 @@ int pop_open_mailbox (CONTEXT *ctx) memset (ctx->rights, 0, sizeof (ctx->rights)); mutt_bit_set (ctx->rights, M_ACL_SEEN); mutt_bit_set (ctx->rights, M_ACL_DELETE); +#if USE_HCACHE + /* flags are managed using header cache, so it only makes sense to + * enable them in that case */ + mutt_bit_set (ctx->rights, M_ACL_WRITE); +#endif FOREVER { @@ -666,6 +671,14 @@ int pop_sync_mailbox (CONTEXT *ctx, int *index_hint) #endif } } + +#if USE_HCACHE + if (ctx->hdrs[i]->changed) + { + mutt_hcache_store (hc, ctx->hdrs[i]->data, ctx->hdrs[i], 0, strlen); + } +#endif + } #if USE_HCACHE -- 2.40.0