SOURCES: mutt-vvv.nntp.patch - from http://mutt.org.ua/download/mu...

qboosh qboosh at pld-linux.org
Fri Jun 15 18:56:18 CEST 2007


Author: qboosh                       Date: Fri Jun 15 16:56:18 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- from http://mutt.org.ua/download/mutt-1.5.16/patch-1.5.16.vvv.nntp.2.gz

---- Files affected:
SOURCES:
   mutt-vvv.nntp.patch (1.5 -> 1.6) 

---- Diffs:

================================================================
Index: SOURCES/mutt-vvv.nntp.patch
diff -u SOURCES/mutt-vvv.nntp.patch:1.5 SOURCES/mutt-vvv.nntp.patch:1.6
--- SOURCES/mutt-vvv.nntp.patch:1.5	Sun Jun  3 15:38:15 2007
+++ SOURCES/mutt-vvv.nntp.patch	Fri Jun 15 18:56:13 2007
@@ -9,10 +9,16 @@
 Vsevolod Volkov <vvv at mutt.org.ua>
 
 
-diff -udprP mutt-1.5.15.orig/ChangeLog.nntp mutt-1.5.15/ChangeLog.nntp
---- mutt-1.5.15.orig/ChangeLog.nntp	1970-01-01 03:00:00.000000000 +0300
-+++ mutt-1.5.15/ChangeLog.nntp	2007-04-11 17:33:57.000000000 +0300
-@@ -0,0 +1,344 @@
+diff -udprP mutt-1.5.16.orig/ChangeLog.nntp mutt-1.5.16/ChangeLog.nntp
+--- mutt-1.5.16.orig/ChangeLog.nntp	1970-01-01 03:00:00.000000000 +0300
++++ mutt-1.5.16/ChangeLog.nntp	2007-06-15 17:14:18.000000000 +0300
+@@ -0,0 +1,350 @@
++* Fri Jun 15 2007 Vsevolod Volkov <vvv at mutt.org.ua>
++- fixed error selecting news group
++
++* Tue Jun 12 2007 Vsevolod Volkov <vvv at mutt.org.ua>
++- update to 1.5.16
++
 +* Wed Apr 11 2007 Vsevolod Volkov <vvv at mutt.org.ua>
 +- fixed posting error if $smtp_url is set
 +- added support of print-style sequence %R (x-comment-to)
@@ -357,6831 +363,37 @@
 +
 +* Fri Jan 28 2000 Vsevolod Volkov <vvv at mutt.kiev.ua>
 +- update to 1.1.2
-diff -udprP mutt-1.5.15.orig/OPS mutt-1.5.15/OPS
---- mutt-1.5.15.orig/OPS	2007-04-02 00:58:55.000000000 +0300
-+++ mutt-1.5.15/OPS	2007-04-11 17:25:15.000000000 +0300
-@@ -8,14 +8,16 @@ OP_BOUNCE_MESSAGE "remail a message to a
- OP_BROWSER_NEW_FILE "select a new file in this directory"
- OP_BROWSER_VIEW_FILE "view file"
- OP_BROWSER_TELL "display the currently selected file's name"
--OP_BROWSER_SUBSCRIBE "subscribe to current mailbox (IMAP only)"
--OP_BROWSER_UNSUBSCRIBE "unsubscribe from current mailbox (IMAP only)"
-+OP_BROWSER_SUBSCRIBE "subscribe to current mbox (IMAP/NNTP only)"
-+OP_BROWSER_UNSUBSCRIBE "unsubscribe from current mbox (IMAP/NNTP only)"
- OP_BROWSER_TOGGLE_LSUB "toggle view all/subscribed mailboxes (IMAP only)"
- OP_BUFFY_LIST "list mailboxes with new mail"
-+OP_CATCHUP "mark all articles in newsgroup as read"
- OP_CHANGE_DIRECTORY "change directories"
- OP_CHECK_NEW "check mailboxes for new mail"
- OP_COMPOSE_ATTACH_FILE "attach file(s) to this message"
- OP_COMPOSE_ATTACH_MESSAGE "attach message(s) to this message"
-+OP_COMPOSE_ATTACH_NEWS_MESSAGE "attach newsmessage(s) to this message"
- OP_COMPOSE_EDIT_BCC "edit the BCC list"
- OP_COMPOSE_EDIT_CC "edit the CC list"
- OP_COMPOSE_EDIT_DESCRIPTION "edit attachment description"
-@@ -26,7 +28,10 @@ OP_COMPOSE_EDIT_FROM "edit the from fiel
- OP_COMPOSE_EDIT_HEADERS "edit the message with headers"
- OP_COMPOSE_EDIT_MESSAGE "edit the message"
- OP_COMPOSE_EDIT_MIME "edit attachment using mailcap entry"
-+OP_COMPOSE_EDIT_NEWSGROUPS "edit the newsgroups list"
- OP_COMPOSE_EDIT_REPLY_TO "edit the Reply-To field"
-+OP_COMPOSE_EDIT_FOLLOWUP_TO "edit the Followup-To field"
-+OP_COMPOSE_EDIT_X_COMMENT_TO "edit the X-Comment-To field"
- OP_COMPOSE_EDIT_SUBJECT "edit the subject of this message"
- OP_COMPOSE_EDIT_TO "edit the TO list"
- OP_CREATE_MAILBOX "create a new mailbox (IMAP only)"
-@@ -85,8 +90,13 @@ OP_EXIT "exit this menu"
- OP_FILTER "filter attachment through a shell command"
- OP_FIRST_ENTRY "move to the first entry"
- OP_FLAG_MESSAGE "toggle a message's 'important' flag"
-+OP_FOLLOWUP "followup to newsgroup"
-+OP_FORWARD_TO_GROUP "forward to newsgroup"
- OP_FORWARD_MESSAGE "forward a message with comments"
- OP_GENERIC_SELECT_ENTRY "select the current entry"
-+OP_GET_CHILDREN "get all children of the current message"
-+OP_GET_MESSAGE "get message with Message-Id"
-+OP_GET_PARENT "get parent of the current message"
- OP_GROUP_REPLY "reply to all recipients"
- OP_HALF_DOWN "scroll down 1/2 page"
- OP_HALF_UP "scroll up 1/2 page"
-@@ -94,11 +104,14 @@ OP_HELP "this screen"
- OP_JUMP "jump to an index number"
- OP_LAST_ENTRY "move to the last entry"
- OP_LIST_REPLY "reply to specified mailing list"
-+OP_LOAD_ACTIVE "load active file from NNTP server"
- OP_MACRO "execute a macro"
- OP_MAIL "compose a new mail message"
- OP_MAIN_BREAK_THREAD "break the thread in two"
- OP_MAIN_CHANGE_FOLDER "open a different folder"
- OP_MAIN_CHANGE_FOLDER_READONLY "open a different folder in read only mode"
-+OP_MAIN_CHANGE_GROUP "open a different newsgroup"
-+OP_MAIN_CHANGE_GROUP_READONLY "open a different newsgroup in read only mode"
- OP_MAIN_CLEAR_FLAG "clear a status flag from a message"
- OP_MAIN_DELETE_PATTERN "delete messages matching a pattern"
- OP_MAIN_IMAP_FETCH "force retrieval of mail from IMAP server"
-@@ -136,6 +149,7 @@ OP_PAGER_HIDE_QUOTED "toggle display of 
- OP_PAGER_SKIP_QUOTED "skip beyond quoted text"
- OP_PAGER_TOP "jump to the top of the message"
- OP_PIPE "pipe message/attachment to a shell command"
-+OP_POST "post message to newsgroup"
- OP_PREV_ENTRY "move to the previous entry"
- OP_PREV_LINE "scroll up one line"
- OP_PREV_PAGE "move to the previous page"
-@@ -144,6 +158,7 @@ OP_QUERY "query external program for add
- OP_QUERY_APPEND "append new query results to current results"
- OP_QUIT "save changes to mailbox and quit"
- OP_RECALL_MESSAGE "recall a postponed message"
-+OP_RECONSTRUCT_THREAD "reconstruct thread containing current message"
- OP_REDRAW "clear and redraw the screen"
- OP_REFORMAT_WINCH "{internal}"
- OP_RENAME_MAILBOX "rename the current mailbox (IMAP only)"
-@@ -158,18 +173,22 @@ OP_SEARCH_TOGGLE "toggle search pattern 
- OP_SHELL_ESCAPE "invoke a command in a subshell"
- OP_SORT "sort messages"
- OP_SORT_REVERSE "sort messages in reverse order"
-+OP_SUBSCRIBE_PATTERN "subscribe to newsgroups matching a pattern"
- OP_TAG "tag the current entry"
- OP_TAG_PREFIX "apply next function to tagged messages"
- OP_TAG_PREFIX_COND "apply next function ONLY to tagged messages"
- OP_TAG_SUBTHREAD "tag the current subthread"
- OP_TAG_THREAD "tag the current thread"
- OP_TOGGLE_NEW "toggle a message's 'new' flag"
-+OP_TOGGLE_READ "toggle view of read messages"
- OP_TOGGLE_WRITE "toggle whether the mailbox will be rewritten"
- OP_TOGGLE_MAILBOXES "toggle whether to browse mailboxes or all files"
- OP_TOP_PAGE "move to the top of the page"
-+OP_UNCATCHUP "mark all articles in newsgroup as unread"
- OP_UNDELETE "undelete the current entry"
- OP_UNDELETE_THREAD "undelete all messages in thread"
- OP_UNDELETE_SUBTHREAD "undelete all messages in subthread"
-+OP_UNSUBSCRIBE_PATTERN "unsubscribe from newsgroups matching a pattern"
- OP_VERSION "show the Mutt version number and date"
- OP_VIEW_ATTACH "view attachment using mailcap entry if necessary"
- OP_VIEW_ATTACHMENTS "show MIME attachments"
-diff -udprP mutt-1.5.15.orig/PATCHES mutt-1.5.15/PATCHES
---- mutt-1.5.15.orig/PATCHES	2007-03-15 17:49:37.000000000 +0200
-+++ mutt-1.5.15/PATCHES	2007-04-11 17:25:15.000000000 +0300
-@@ -0,0 +1 @@
-+vvv.nntp
-diff -udprP mutt-1.5.15.orig/account.c mutt-1.5.15/account.c
---- mutt-1.5.15.orig/account.c	2007-04-02 00:58:55.000000000 +0300
-+++ mutt-1.5.15/account.c	2007-04-11 17:25:15.000000000 +0300
-@@ -54,6 +54,11 @@ int mutt_account_match (const ACCOUNT* a
-     user = PopUser;
- #endif
-   
-+#ifdef USE_NNTP
-+  if (a1->type == M_ACCT_TYPE_NNTP && NntpUser)
-+    user = NntpUser;
-+#endif
-+
-   if (a1->flags & a2->flags & M_ACCT_USER)
-     return (!strcmp (a1->user, a2->user));
-   if (a1->flags & M_ACCT_USER)
-@@ -133,6 +138,16 @@ void mutt_account_tourl (ACCOUNT* accoun
-   }
- #endif
- 
-+#ifdef USE_NNTP
-+  if (account->type == M_ACCT_TYPE_NNTP)
-+  {
-+    if (account->flags & M_ACCT_SSL)
-+      url->scheme = U_NNTPS;
-+    else
-+      url->scheme = U_NNTP;
-+  }
-+#endif
-+
-   url->host = account->host;
-   if (account->flags & M_ACCT_PORT)
-     url->port = account->port;
-@@ -158,6 +173,10 @@ int mutt_account_getuser (ACCOUNT* accou
-   else if ((account->type == M_ACCT_TYPE_POP) && PopUser)
-     strfcpy (account->user, PopUser, sizeof (account->user));
- #endif
-+#ifdef USE_NNTP
-+  else if ((account->type == M_ACCT_TYPE_NNTP) && NntpUser)
-+    strfcpy (account->user, NntpUser, sizeof (account->user));
-+#endif
-   /* prompt (defaults to unix username), copy into account->user */
-   else
-   {
-@@ -214,6 +233,10 @@ int mutt_account_getpass (ACCOUNT* accou
-   else if ((account->type == M_ACCT_TYPE_POP) && PopPass)
-     strfcpy (account->pass, PopPass, sizeof (account->pass));
- #endif
-+#ifdef USE_NNTP
-+  else if ((account->type == M_ACCT_TYPE_NNTP) && NntpPass)
-+    strfcpy (account->pass, NntpPass, sizeof (account->pass));
-+#endif
-   else
-   {
-     snprintf (prompt, sizeof (prompt), _("Password for %s@%s: "),
-diff -udprP mutt-1.5.15.orig/account.h mutt-1.5.15/account.h
---- mutt-1.5.15.orig/account.h	2007-04-02 00:58:55.000000000 +0300
-+++ mutt-1.5.15/account.h	2007-04-11 17:25:15.000000000 +0300
-@@ -29,7 +29,8 @@ enum
-   M_ACCT_TYPE_NONE = 0,
-   M_ACCT_TYPE_IMAP,
-   M_ACCT_TYPE_POP,
--  M_ACCT_TYPE_SMTP
-+  M_ACCT_TYPE_SMTP,
-+  M_ACCT_TYPE_NNTP
- };
- 
- /* account flags */
-diff -udprP mutt-1.5.15.orig/attach.h mutt-1.5.15/attach.h
---- mutt-1.5.15.orig/attach.h	2007-04-02 00:58:55.000000000 +0300
-+++ mutt-1.5.15/attach.h	2007-04-11 17:25:15.000000000 +0300
-@@ -50,7 +50,7 @@ void mutt_print_attachment_list (FILE *f
- 
- void mutt_attach_bounce (FILE *, HEADER *, ATTACHPTR **, short, BODY *);
- void mutt_attach_resend (FILE *, HEADER *, ATTACHPTR **, short, BODY *);
--void mutt_attach_forward (FILE *, HEADER *, ATTACHPTR **, short, BODY *);
-+void mutt_attach_forward (FILE *, HEADER *, ATTACHPTR **, short, BODY *, int);
- void mutt_attach_reply (FILE *, HEADER *, ATTACHPTR **, short, BODY *, int);
- 
- #endif /* _ATTACH_H_ */
-diff -udprP mutt-1.5.15.orig/browser.c mutt-1.5.15/browser.c
---- mutt-1.5.15.orig/browser.c	2007-04-03 07:57:21.000000000 +0300
-+++ mutt-1.5.15/browser.c	2007-04-11 17:25:15.000000000 +0300
-@@ -32,6 +32,9 @@
- #ifdef USE_IMAP
- #include "imap.h"
- #endif
-+#ifdef USE_NNTP
-+#include "nntp.h"
-+#endif
- 
- #include <stdlib.h>
- #include <dirent.h>
-@@ -49,6 +52,19 @@ static struct mapping_t FolderHelp[] = {
-   { NULL }
- };
+diff -udprP mutt-1.5.16.orig/Makefile.am mutt-1.5.16/Makefile.am
+--- mutt-1.5.16.orig/Makefile.am	2007-06-04 07:20:01.000000000 +0300
++++ mutt-1.5.16/Makefile.am	2007-06-15 17:12:26.000000000 +0300
+@@ -62,6 +62,7 @@ EXTRA_mutt_SOURCES = account.c md5c.c mu
+ 	smtp.c browser.h mbyte.h remailer.h url.h \
+ 	crypt-mod-pgp-classic.c crypt-mod-smime-classic.c \
+ 	pgppacket.c mutt_idna.h hcache.h hcache.c bcache.c bcache.h mutt_ssl_gnutls.c \
++	nntp.c newsrc.c \
+ 	crypt-gpgme.c crypt-mod-pgp-gpgme.c crypt-mod-smime-gpgme.c \
+ 	utf8.c wcwidth.c 
  
-+#ifdef USE_NNTP
-+static struct mapping_t FolderNewsHelp[] = {
-+  { N_("Exit"),        OP_EXIT },
-+  { N_("List"),        OP_TOGGLE_MAILBOXES },
-+  { N_("Subscribe"),   OP_BROWSER_SUBSCRIBE },
-+  { N_("Unsubscribe"), OP_BROWSER_UNSUBSCRIBE },
-+  { N_("Catchup"),     OP_CATCHUP },
-+  { N_("Mask"),        OP_ENTER_MASK },
-+  { N_("Help"),        OP_HELP },
-+  { NULL }
-+};
-+#endif
-+
- typedef struct folder_t
- {
-   struct folder_file *ff;
-@@ -114,9 +130,17 @@ static void browser_sort (struct browser
-     case SORT_ORDER:
-       return;
-     case SORT_DATE:
-+#ifdef USE_NNTP
-+      if (option (OPTNEWS))
-+	return;
-+#endif
-       f = browser_compare_date;
-       break;
-     case SORT_SIZE:
-+#ifdef USE_NNTP
-+      if (option (OPTNEWS))
-+	return;
-+#endif
-       f = browser_compare_size;
-       break;
-     case SORT_SUBJECT:
-@@ -306,8 +330,106 @@ folder_format_str (char *dest, size_t de
-   return (src);
- }
+@@ -73,6 +74,7 @@ EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP O
+ 	mutt_regex.h mutt_sasl.h mutt_socket.h mutt_ssl.h mutt_tunnel.h \
+ 	mx.h pager.h pgp.h pop.h protos.h rfc1524.h rfc2047.h \
+ 	rfc2231.h rfc822.h rfc3676.h sha1.h sort.h mime.types VERSION prepare \
++	nntp.h ChangeLog.nntp \
+ 	_regex.h OPS.MIX README.SECURITY remailer.c remailer.h browser.h \
+ 	mbyte.h lib.h extlib.c pgpewrap.c smime_keys.pl pgplib.h Muttrc.head Muttrc \
+ 	makedoc.c makedoc-defs.h stamp-doc-rc README.SSL smime.h \
+diff -udprP mutt-1.5.16.orig/Makefile.in mutt-1.5.16/Makefile.in
+--- mutt-1.5.16.orig/Makefile.in	2007-06-10 05:43:26.000000000 +0300
++++ mutt-1.5.16/Makefile.in	2007-06-15 17:12:26.000000000 +0300
+@@ -331,6 +331,7 @@ EXTRA_mutt_SOURCES = account.c md5c.c mu
+ 	smtp.c browser.h mbyte.h remailer.h url.h \
+ 	crypt-mod-pgp-classic.c crypt-mod-smime-classic.c \
+ 	pgppacket.c mutt_idna.h hcache.h hcache.c bcache.c bcache.h mutt_ssl_gnutls.c \
++	nntp.c newsrc.c \
+ 	crypt-gpgme.c crypt-mod-pgp-gpgme.c crypt-mod-smime-gpgme.c \
+ 	utf8.c wcwidth.c 
  
-+#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;
-+
-+    case 'n':
-+      if (Context && Context->data == folder->ff->nd)
-+      {
-+	snprintf (tmp, sizeof (tmp), "%%%sd", fmt);
-+	snprintf (dest, destlen, tmp, Context->new);
-+      }
-+      else if (option (OPTMARKOLD) &&
-+		folder->ff->nd->lastCached >= folder->ff->nd->firstMessage &&
-+		folder->ff->nd->lastCached <= folder->ff->nd->lastMessage)
-+      {
-+	snprintf (tmp, sizeof (tmp), "%%%sd", fmt);
-+	snprintf (dest, destlen, tmp, folder->ff->nd->lastMessage - folder->ff->nd->lastCached);
-+      }
-+      else
-+      {
-+	snprintf (tmp, sizeof (tmp), "%%%sd", fmt);
-+	snprintf (dest, destlen, tmp, folder->ff->nd->unread);
-+      }
-+      break;
-+
-+    case 'd':
-+      if (folder->ff->nd->desc != NULL)
-+      {
-+	snprintf (tmp, sizeof (tmp), "%%%ss", fmt);
-+	snprintf (dest, destlen, tmp, folder->ff->nd->desc);
-+      }
-+      else
-+      {
-+	snprintf (tmp, sizeof (tmp), "%%%ss", fmt);
-+	snprintf (dest, destlen, tmp, "");
-+      }
-+      break;
-+  }
-+  return (src);
-+}
-+#endif /* USE_NNTP */
-+
- static void add_folder (MUTTMENU *m, struct browser_state *state,
--			const char *name, const struct stat *s, int new)
-+			const char *name, const struct stat *s,
-+			void *data, int new)
- {
-   if (state->entrylen == state->entrymax)
-   {
-@@ -336,6 +458,10 @@ static void add_folder (MUTTMENU *m, str
- #ifdef USE_IMAP
-   (state->entry)[state->entrylen].imap = 0;
- #endif
-+#ifdef USE_NNTP
-+  if (option (OPTNEWS))
-+    (state->entry)[state->entrylen].nd = (NNTP_DATA *) data;
-+#endif
-   (state->entrylen)++;
- }
- 
-@@ -351,9 +477,35 @@ static void init_state (struct browser_s
-     menu->data = state->entry;
- }
- 
-+/* get list of all files/newsgroups with mask */
- static int examine_directory (MUTTMENU *menu, struct browser_state *state,
- 			      char *d, const char *prefix)
- {
-+#ifdef USE_NNTP
-+  if (option (OPTNEWS))
-+  {
-+    LIST *tmp;
-+    NNTP_DATA *data;
-+    NNTP_SERVER *news = CurrentNewsSrv;
-+
-+/*  mutt_buffy_check (0); */
-+    init_state (state, menu);
-+
-+    for (tmp = news->list; tmp; tmp = tmp->next)
-+    {
-+      if (!(data = (NNTP_DATA *)tmp->data))
-+	continue;
-+      if (prefix && *prefix && strncmp (prefix, data->group,
-+	    strlen (prefix)) != 0)
-+	continue;
-+      if (!((regexec (Mask.rx, data->group, 0, NULL, 0) == 0) ^ Mask.not))
-+	continue;
-+      add_folder (menu, state, data->group, NULL, data, data->new);
-+    }
-+  }
-+  else
-+#endif /* USE_NNTP */
-+  {
-   struct stat s;
-   DIR *dp;
-   struct dirent *de;
-@@ -414,17 +566,40 @@ static int examine_directory (MUTTMENU *
-     tmp = Incoming;
-     while (tmp && mutt_strcmp (buffer, tmp->path))
-       tmp = tmp->next;
--    add_folder (menu, state, de->d_name, &s, (tmp) ? tmp->new : 0);
-+    add_folder (menu, state, de->d_name, &s, NULL, (tmp) ? tmp->new : 0);
-+  }
-+  closedir (dp);
-   }
--  closedir (dp);  
-   browser_sort (state);
-   return 0;
- }
- 
-+/* get list of mailboxes/subscribed newsgroups */
- static int examine_mailboxes (MUTTMENU *menu, struct browser_state *state)
- {
-   struct stat s;
-   char buffer[LONG_STRING];
-+
-+#ifdef USE_NNTP
-+  if (option (OPTNEWS))
-+  {
-+    LIST *tmp;
-+    NNTP_DATA *data;
-+    NNTP_SERVER *news = CurrentNewsSrv;
-+
-+/*  mutt_buffy_check (0); */
-+    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))))
-+        add_folder (menu, state, data->group, NULL, data, data->new);
-+    }
-+  }
-+  else
-+#endif
-+  {
-   BUFFY *tmp = Incoming;
- #ifdef USE_IMAP
-   struct mailbox_state mbox;
-@@ -442,14 +617,21 @@ static int examine_mailboxes (MUTTMENU *
-     if (mx_is_imap (tmp->path))
-     {
-       imap_mailbox_state (tmp->path, &mbox);
--      add_folder (menu, state, tmp->path, NULL, mbox.new);
-+      add_folder (menu, state, tmp->path, NULL, NULL, mbox.new);
-       continue;
-     }
- #endif
- #ifdef USE_POP
-     if (mx_is_pop (tmp->path))
-     {
--      add_folder (menu, state, tmp->path, NULL, tmp->new);
-+      add_folder (menu, state, tmp->path, NULL, NULL, tmp->new);
-+      continue;
-+    }
-+#endif
-+#ifdef USE_NNTP
-+    if (mx_is_nntp (tmp->path))
-+    {
-+      add_folder (menu, state, tmp->path, NULL, NULL, tmp->new);
-       continue;
-     }
- #endif
-@@ -463,15 +645,20 @@ static int examine_mailboxes (MUTTMENU *
-     strfcpy (buffer, NONULL(tmp->path), sizeof (buffer));
-     mutt_pretty_mailbox (buffer);
- 
--    add_folder (menu, state, buffer, &s, tmp->new);
-+    add_folder (menu, state, buffer, &s, NULL, tmp->new);
-   }
-   while ((tmp = tmp->next));
-+  }
-   browser_sort (state);
-   return 0;
- }
- 
- static int select_file_search (MUTTMENU *menu, regex_t *re, int n)
- {
-+#ifdef USE_NNTP
-+  if (option (OPTNEWS))
-+    return (regexec (re, ((struct folder_file *) menu->data)[n].desc, 0, NULL, 0));
-+#endif
-   return (regexec (re, ((struct folder_file *) menu->data)[n].name, 0, NULL, 0));
- }
- 
-@@ -482,7 +669,13 @@ static void folder_entry (char *s, size_
-   folder.ff = &((struct folder_file *) menu->data)[num];
-   folder.num = num;
-   
--  mutt_FormatString (s, slen, NONULL(FolderFormat), folder_format_str, 
-+#ifdef USE_NNTP
-+  if (option (OPTNEWS))
-+    mutt_FormatString (s, slen, NONULL(GroupFormat), newsgroup_format_str, 
-+      (unsigned long) &folder, M_FORMAT_ARROWCURSOR);
-+  else
-+#endif
-+    mutt_FormatString (s, slen, NONULL(FolderFormat), folder_format_str, 
-       (unsigned long) &folder, M_FORMAT_ARROWCURSOR);
- }
- 
-@@ -502,6 +695,17 @@ static void init_menu (struct browser_st
- 
-   menu->tagged = 0;
-   
-+#ifdef USE_NNTP
-+  if (option (OPTNEWS))
-+  {
-+    if (buffy)
-+      snprintf (title, titlelen, _("Subscribed newsgroups"));
-+    else
-+      snprintf (title, titlelen, _("Newsgroups on server [%s]"),
-+		CurrentNewsSrv->conn->account.host);
-+  }
-+  else
-+#endif
-   if (buffy)
-     snprintf (title, titlelen, _("Mailboxes [%d]"), mutt_buffy_check (0));
-   else
-@@ -557,6 +761,31 @@ void _mutt_select_file (char *f, size_t 
-   if (!folder)
-     strfcpy (LastDirBackup, LastDir, sizeof (LastDirBackup));
- 
-+#ifdef USE_NNTP
-+  if (option (OPTNEWS))
-+  {
-+    if (*f)
-+      strfcpy (prefix, f, sizeof (prefix));
-+    else
-+    {
-+      LIST *list;
-+
-+      /* default state for news reader mode is browse subscribed newsgroups */
-+      buffy = 0;
-+      for (list = CurrentNewsSrv->list; list; list = list->next)
-+      {
-+	NNTP_DATA *data = (NNTP_DATA *) list->data;
-+
-+	if (data && data->subscribed)
-+	{
-+	  buffy = 1;
-+	  break;
-+	}
-+      }
-+    }
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/mutt-vvv.nntp.patch?r1=1.5&r2=1.6&f=u



More information about the pld-cvs-commit mailing list