- for (i = 0; i < Context->msgcount; i++)
- if (!Context->hdrs[i]->read && !Context->hdrs[i]->deleted)
- unread++;
- if (!unread)
- continue;
+ while (count < 2) {
+
+ if (!list)
+ list = CurrentNewsSrv->list;
+
+ for (; list; list = list->next) {
+ NNTP_DATA *data = (NNTP_DATA *) list->data;
+
+ if (data && data->subscribed && data->unread) {
+ if (Context && Context->magic == M_NNTP &&
+ !m_strcmp(data->group, ((NNTP_DATA *) Context->data)->group)) {
+ unsigned int i, unread = 0;
+
+ for (i = 0; i < Context->msgcount; i++)
+ if (!Context->hdrs[i]->read && !Context->hdrs[i]->deleted)
+ unread++;
+ if (!unread)
+ continue;
+ }
+ strncpy (dst, data->group, dstlen);
+ break;