nntp_parse_xover (ctx, line, ctx->hdrs[ctx->msgcount]);
num = ctx->hdrs[ctx->msgcount]->article_num;
- if (bit_isset(&fc->messages, num)) {
+ if (num >= fc->first && num <= fc->last) {
ctx->msgcount++;
if (num > data->lastLoaded)
data->lastLoaded = num;
total = fc->last - fc->first + 1;
if (!ctx->quiet && fc->msg && ReadInc && (num % ReadInc == 0))
mutt_message ("%s %d/%d", fc->msg, num, total);
- }
- else
+ } else {
header_delete(&ctx->hdrs[ctx->msgcount]); /* skip it */
+ }
return 0;
}
fc.ctx = ctx;
fc.first = first;
fc.last = last;
- bits_init(&fc.messages);
-
- if (nntp_data->nserv->hasLISTGROUP) {
- snprintf (buf, sizeof (buf), "LISTGROUP %s\r\n", nntp_data->group);
- if (mutt_nntp_fetch(nntp_data, buf, NULL, NULL,
- nntp_fetch_numbers, &fc, 0))
- {
- mutt_error (_("LISTGROUP command failed: %s"), buf);
- sleep (2);
- bits_wipe(&fc.messages);
- return -1;
- }
- } else {
- for (num = first; num <= last; num++)
- bit_set(&fc.messages, num);
- }
/* CACHE: must be loaded xover cache here */
num = nntp_data->lastCached - first + 1;
}
num = last - first + 1;
if (num <= 0) {
- bits_wipe(&fc.messages);
return 0;
}
mx_update_context (ctx, ctx->msgcount - oldmsgcount);
if (ret != 0) {
mutt_error (_("XOVER command failed: %s"), buf);
- bits_wipe(&fc.messages);
return -1;
}
- /* fetched OK */
} else {
+ bits_init(&fc.messages);
+
+ if (nntp_data->nserv->hasLISTGROUP) {
+ snprintf (buf, sizeof (buf), "LISTGROUP %s\r\n", nntp_data->group);
+ if (mutt_nntp_fetch(nntp_data, buf, NULL, NULL,
+ nntp_fetch_numbers, &fc, 0))
+ {
+ mutt_error (_("LISTGROUP command failed: %s"), buf);
+ sleep (2);
+ bits_wipe(&fc.messages);
+ return -1;
+ }
+ } else {
+ for (num = first; num <= last; num++)
+ bit_set(&fc.messages, num);
+ }
+
for (current = first; current <= last; current++) {
HEADER *h;
if (current > nntp_data->lastLoaded)
nntp_data->lastLoaded = current;
}
+ bits_wipe(&fc.messages);
}
- bits_wipe(&fc.messages);
+
nntp_data->lastLoaded = last;
mutt_clear_error ();
return 0;
}
-/*
+/*
* currently, nntp "mailbox" is "newsgroup"
*/
static int nntp_open_mailbox (CONTEXT * ctx)