- if (!ascii_strncasecmp ("FETCH", pc, 5))
- {
- while (*pc)
- {
- pc = imap_next_word (pc);
- if (pc[0] == '(')
- pc++;
- if (ascii_strncasecmp ("UID", pc, 3) == 0)
- {
- pc = imap_next_word (pc);
- uid = atoi (pc);
- if (uid != HEADER_DATA(h)->uid)
- mutt_error (_("The message index is incorrect. Try reopening the mailbox."));
- }
- else if ((ascii_strncasecmp ("RFC822", pc, 6) == 0) ||
- (ascii_strncasecmp ("BODY[]", pc, 6) == 0))
- {
- pc = imap_next_word (pc);
- if (imap_get_literal_count(pc, &bytes) < 0)
- {
- imap_error ("imap_fetch_message()", buf);
- goto bail;
- }
- if (imap_read_literal (msg->fp, idata, bytes) < 0)
- goto bail;
- /* pick up trailing line */
- if ((rc = imap_cmd_step (idata)) != IMAP_CMD_CONTINUE)
- goto bail;
- pc = idata->cmd.buf;
-
- fetched = 1;
- }
- /* UW-IMAP will provide a FLAGS update here if the FETCH causes a
- * change (eg from \Unseen to \Seen).
- * Uncommitted changes in mutt take precedence. If we decide to
- * incrementally update flags later, this won't stop us syncing */
- else if ((ascii_strncasecmp ("FLAGS", pc, 5) == 0) && !h->changed)
- {
- if ((pc = imap_set_flags (idata, h, pc)) == NULL)
- goto bail;
- }
+ if (!ascii_strncasecmp ("FETCH", pc, 5)) {
+ while (*pc) {
+ pc = imap_next_word (pc);
+ if (pc[0] == '(')
+ pc++;
+ if (ascii_strncasecmp ("UID", pc, 3) == 0) {
+ pc = imap_next_word (pc);
+ uid = atoi (pc);
+ if (uid != HEADER_DATA(h)->uid)
+ mutt_error (_
+ ("The message index is incorrect. Try reopening the mailbox."));
+ }
+ else if ((ascii_strncasecmp ("RFC822", pc, 6) == 0) ||
+ (ascii_strncasecmp ("BODY[]", pc, 6) == 0)) {
+ pc = imap_next_word (pc);
+ if (imap_get_literal_count (pc, &bytes) < 0) {
+ imap_error ("imap_fetch_message()", buf);
+ goto bail;
+ }
+ bar.size = bytes;
+ bar.msg = _("Fetching message...");
+ mutt_progress_bar (&bar, 0);
+ if (imap_read_literal (msg->fp, idata, bytes, &bar) < 0)
+ goto bail;
+ /* pick up trailing line */
+ if ((rc = imap_cmd_step (idata)) != IMAP_CMD_CONTINUE)
+ goto bail;
+ pc = idata->cmd.buf;
+
+ fetched = 1;
+ }
+ /* UW-IMAP will provide a FLAGS update here if the FETCH causes a
+ * change (eg from \Unseen to \Seen).
+ * Uncommitted changes in mutt take precedence. If we decide to
+ * incrementally update flags later, this won't stop us syncing */
+ else if ((ascii_strncasecmp ("FLAGS", pc, 5) == 0) && !h->changed) {
+ if ((pc = imap_set_flags (idata, h, pc)) == NULL)
+ goto bail;
+ }