-static void nntp_error (const char *where, const char *msg) {
- debug_print (1, ("unexpected response in %s: %s\n", where, msg));
+void nntp_sync_sidebar (NNTP_DATA* data) {
+ int i = 0;
+ BUFFY* tmp = NULL;
+ char buf[STRING];
+
+ if (!Incoming.len)
+ return;
+
+ /* unfortunately, NNTP_DATA::group only is the plain
+ * group name, so for every single update, we need to
+ * compose the full string which must be defined via
+ * mailboxes command ;-((( FIXME
+ */
+ buf[0] = '\0';
+ 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);
+
+ /* bail out if group not found via mailboxes */
+ if ((i = buffy_lookup (buf)) < 0)
+ return;
+
+ tmp = Incoming.arr[i];
+ /* copied from browser.c */
+ if (option (OPTMARKOLD) &&
+ data->lastCached >= data->firstMessage &&
+ data->lastCached <= data->lastMessage)
+ tmp->msg_unread = data->lastMessage - data->lastCached;
+ else
+ tmp->msg_unread = data->unread;
+ tmp->new = data->unread > 0;
+ /* this is closest to a "total" count we can get */
+ tmp->msgcount = data->lastMessage - data->firstMessage;