- if (optional)
- mutt_FormatString (dest, destlen, ifstring, folder_format_str, data, 0);
- else if (flags & M_FORMAT_OPTIONAL)
- mutt_FormatString (dest, destlen, elsestring, folder_format_str, data, 0);
-
- return (src);
-}
-
-#ifdef USE_NNTP
-static const char *newsgroup_format_str (char *dest, size_t destlen, char op,
- const char *src, const char *fmt,
- const char *ifstring,
- const char *elsestring,
- unsigned long data,
- format_flag flags)
-{
- char fn[SHORT_STRING], tmp[SHORT_STRING];
- FOLDER *folder = (FOLDER *) data;
-
- switch (op) {
- case 'C':
- snprintf (tmp, sizeof (tmp), "%%%sd", fmt);
- snprintf (dest, destlen, tmp, folder->num + 1);
- break;
-
- case 'f':
- strncpy (fn, folder->ff->name, sizeof (fn) - 1);
- snprintf (tmp, sizeof (tmp), "%%%ss", fmt);
- snprintf (dest, destlen, tmp, fn);
- break;
-
- case 'N':
- snprintf (tmp, sizeof (tmp), "%%%sc", fmt);
- if (folder->ff->nd->subscribed)
- snprintf (dest, destlen, tmp, ' ');
- else
- snprintf (dest, destlen, tmp, folder->ff->new ? 'N' : 'u');
- break;
-
- case 'M':
- snprintf (tmp, sizeof (tmp), "%%%sc", fmt);
- if (folder->ff->nd->deleted)
- snprintf (dest, destlen, tmp, 'D');
- else
- snprintf (dest, destlen, tmp, folder->ff->nd->allowed ? ' ' : '-');
- break;
-
- case 's':
- if (flags & M_FORMAT_OPTIONAL) {
- if (folder->ff->nd->unread != 0)
- mutt_FormatString (dest, destlen, ifstring, newsgroup_format_str,
- data, flags);
- else
- mutt_FormatString (dest, destlen, elsestring, newsgroup_format_str,
- data, flags);
- }
- else if (Context && Context->data == folder->ff->nd) {
- snprintf (tmp, sizeof (tmp), "%%%sd", fmt);
- snprintf (dest, destlen, tmp, Context->unread);
- }
- else {
- snprintf (tmp, sizeof (tmp), "%%%sd", fmt);
- snprintf (dest, destlen, tmp, folder->ff->nd->unread);
- }
- break;