for (tmp = news->list; tmp; tmp = tmp->next) {
if (!(data = (NNTP_DATA *) tmp->data))
continue;
+ nntp_sync_sidebar (data);
if (prefix && *prefix && strncmp (prefix, data->group,
str_len (prefix)) != 0)
continue;
continue;
add_folder (menu, state, data->group, NULL, data, data->new);
}
+ sidebar_draw (CurrentMenu);
}
else
#endif /* USE_NNTP */
init_state (state, menu);
for (tmp = news->list; tmp; tmp = tmp->next) {
- if ((data = (NNTP_DATA *) tmp->data) != NULL && (data->new ||
- (data->subscribed
- &&
- (!option
- (OPTSHOWONLYUNREAD)
- || data->unread))))
+ if ((data = (NNTP_DATA*) tmp->data) == NULL)
+ continue;
+ nntp_sync_sidebar (data);
+ if ((data->new || (data->subscribed &&
+ (!option (OPTSHOWONLYUNREAD)|| data->unread))))
add_folder (menu, state, data->group, NULL, data, data->new);
}
+ sidebar_draw (CurrentMenu);
}
else
#endif
if (menu->current < 0)
menu->current = ci_first_message ();
-
}
static void resort_index (MUTTMENU * menu)
{
if (Context && Context->path)
strncpy (buf, Context->path, sizeof (buf));
- if (op != OP_SIDEBAR_OPEN)
- buffy_next (buf, sizeof (buf));
+ if (op != OP_SIDEBAR_OPEN)
+ buffy_next (buf, sizeof (buf));
}
if (op == OP_SIDEBAR_OPEN) {
static unsigned int _checked = 0;
-static void update_sidebar (NNTP_DATA* data) {
+void nntp_sync_sidebar (NNTP_DATA* data) {
int i = 0;
BUFFY* tmp = NULL;
char buf[STRING];
* mailboxes command ;-((( FIXME
*/
buf[0] = '\0';
- snprintf (buf, sizeof (buf), "nntp%s://%s%s/%s",
+ snprintf (buf, sizeof (buf), "nntp%s://%s%s%s%s/%s",
(data->nserv->conn->account.flags & M_ACCT_SSL) ? "s" : "",
NONULL (data->nserv->conn->account.user),
+ *data->nserv->conn->account.pass ? ":" : "",
+ *data->nserv->conn->account.pass ? data->nserv->conn->account.pass : "",
data->nserv->conn->account.host,
data->group);
debug_print (4, ("group == '%s'\n", buf));
if (colon) {
*colon = '\0';
colon++;
- nntp_get_status (ctx, h, p, atoi (colon));
+ nntp_get_status (ctx, h, b, atoi (colon));
if (h && h->article_num == 0 && str_cmp (group, b) == 0)
h->article_num = atoi (colon);
}
unsigned int first;
ACCOUNT acct;
+ memset (&acct, 0, sizeof (ACCOUNT));
+
if (nntp_parse_url (ctx->path, &acct, buf, sizeof (buf)) < 0 || !*buf) {
mutt_error (_("%s is an invalid newsgroup specification!"), ctx->path);
mutt_sleep (2);
|| tmp != data)
nntp_delete_data (data);
else
- update_sidebar (data);
+ nntp_sync_sidebar (data);
}
/* commit changes and terminate connection */
nntp_data->entries[0].first = 1;
nntp_data->entries[0].last = 0;
}
- update_sidebar (nntp_data);
+ nntp_sync_sidebar (nntp_data);
}
time (&nntp_data->nserv->check_time);
if (l->data && ((NNTP_DATA *) l->data)->subscribed)
_nntp_check_mailbox (NULL, (NNTP_DATA *) l->data);
}
+ sidebar_draw (CurrentMenu);
}
else if (!force)
return 0;
const char *nntp_format_str (char *, size_t, char, const char *, const char *,
const char *, const char *, unsigned long,
format_flag);
+void nntp_sync_sidebar (NNTP_DATA*);
NNTP_SERVER *CurrentNewsSrv INITVAL (NULL);