Rocco Rutte:
[apps/madmutt.git] / pop / pop.c
index f53f76a..34d1cc7 100644 (file)
--- 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)