From 7b941151492d80950ed6a3b35bb50e7f95f9dcfd Mon Sep 17 00:00:00 2001 From: Takahashi Tamotsu Date: Fri, 15 May 2009 15:03:40 +0200 Subject: [PATCH] POP: Notify user when messages are lost. Closes #2226. --- pop.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pop.c b/pop.c index 35b199bc3..ec1af2329 100644 --- a/pop.c +++ b/pop.c @@ -226,7 +226,7 @@ static header_cache_t *pop_hcache_open (POP_DATA *pop_data, const char *path) */ static int pop_fetch_headers (CONTEXT *ctx) { - int i, ret, old_count, new_count; + int i, ret, old_count, new_count, deleted; unsigned short hcached = 0, bcached; POP_DATA *pop_data = (POP_DATA *)ctx->data; progress_t progress; @@ -274,9 +274,20 @@ static int pop_fetch_headers (CONTEXT *ctx) if (ret == 0) { - for (i = 0; i < old_count; i++) + for (i = 0, deleted = 0; i < old_count; i++) + { if (ctx->hdrs[i]->refno == -1) + { ctx->hdrs[i]->deleted = 1; + deleted++; + } + } + if (deleted > 0) + { + mutt_error (_("%d messages have been lost. Try reopening the mailbox."), + deleted); + mutt_sleep (2); + } for (i = old_count; i < new_count; i++) { -- 2.40.0