X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=pop%2Fpop.c;h=34d1cc779e126ca2eec31738df223b81952256f3;hp=f53f76a57ab6bb9d78a017d5a3415b99af3799be;hb=c8ceef3ed6424dcb5a6ec835e7d8d9cc00595372;hpb=fa2fd1900f206da4bb975b5ece50ee29f5bd8a75 diff --git a/pop/pop.c b/pop/pop.c index f53f76a..34d1cc7 100644 --- a/pop/pop.c +++ b/pop/pop.c @@ -15,6 +15,7 @@ #include "mx.h" #include "pop.h" #include "mutt_crypt.h" +#include "mutt_curses.h" #include "lib/mem.h" #include "lib/str.h" @@ -326,7 +327,7 @@ int pop_fetch_message (MESSAGE * msg, CONTEXT * ctx, int msgno) void *uidl; char buf[LONG_STRING]; char path[_POSIX_PATH_MAX]; - char *m = _("Fetching message..."); + progress_t bar; POP_DATA *pop_data = (POP_DATA *) ctx->data; POP_CACHE *cache; HEADER *h = ctx->hdrs[msgno]; @@ -364,7 +365,9 @@ int pop_fetch_message (MESSAGE * msg, CONTEXT * ctx, int msgno) return -1; } - mutt_message (m); + bar.size = h->content->length + h->content->offset - 1; + bar.msg = _("Fetching message..."); + mutt_progress_bar (&bar, 0); mutt_mktemp (path); msg->fp = safe_fopen (path, "w+"); @@ -376,7 +379,7 @@ int pop_fetch_message (MESSAGE * msg, CONTEXT * ctx, int msgno) snprintf (buf, sizeof (buf), "RETR %d\r\n", h->refno); - ret = pop_fetch_data (pop_data, buf, m, fetch_message, msg->fp); + ret = pop_fetch_data (pop_data, buf, &bar, fetch_message, msg->fp); if (ret == PQ_OK) break; @@ -414,7 +417,7 @@ int pop_fetch_message (MESSAGE * msg, CONTEXT * ctx, int msgno) fgets (buf, sizeof (buf), msg->fp); } - h->content->length = ftell (msg->fp) - h->content->offset; + h->content->length = ftello (msg->fp) - h->content->offset; /* This needs to be done in case this is a multipart message */ if (!WithCrypto)