merge all nntp code in nntp.c and move it toplevel
[apps/madmutt.git] / lib-ui / curs_main.c
index 799d08b..dc78290 100644 (file)
 #include "recvattach.h"
 #include "buffy.h"
 #include "thread.h"
+#include "score.h"
 
 #include <imap/imap_private.h>
 
 #ifdef USE_NNTP
-#include <nntp/nntp.h>
+#include "nntp.h"
 #endif
 
 static const char *No_mailbox_is_open = N_("No mailbox is open.");
@@ -97,9 +98,6 @@ void index_make_entry (char *s, ssize_t l, struct menu_t * menu, int num)
   HEADER *h = Context->hdrs[Context->v2r[num]];
   THREAD *tmp;
 
-  if (option(OPTARROWCURSOR))
-      flag |= M_FORMAT_ARROWCURSOR;
-
   if ((Sort & SORT_MASK) == SORT_THREADS && h->tree) {
     flag |= M_FORMAT_TREE;      /* display the thread tree */
     if (h->display_subject)
@@ -474,7 +472,7 @@ int mutt_index_menu (void)
           sidebar_draw ();
           mutt_message (_("New mail in this mailbox."));
 
-          if (MCore.beep_new)
+          if (mod_core.beep_new)
             beep ();
         }
         else if (check == M_FLAGS)
@@ -501,7 +499,7 @@ int mutt_index_menu (void)
         menu->redraw |= REDRAW_SIDEBAR;
       }
       if (do_buffy_notify) {
-        if (buffy_notify () && MCore.beep_new)
+        if (buffy_notify () && mod_core.beep_new)
           beep ();
       }
       else
@@ -559,9 +557,7 @@ int mutt_index_menu (void)
       else
         menu->oldcurrent = -1;
 
-      if (option (OPTARROWCURSOR))
-        move (menu->current - menu->top + menu->offset, 2);
-       else if (option (OPTBRAILLEFRIENDLY))
+      if (option (OPTBRAILLEFRIENDLY))
          move (menu->current - menu->top + menu->offset, 0);
       else
         move (menu->current - menu->top + menu->offset, COLS - 1);
@@ -969,7 +965,7 @@ int mutt_index_menu (void)
         break;
       }
 
-      if (query_quadoption2(MCore.quit, _("Quit Madmutt?")) == M_YES) {
+      if (query_quadoption2(mod_core.quit, _("Quit Madmutt?")) == M_YES) {
         int check;
 
         oldcount = Context ? Context->msgcount : 0;
@@ -1275,8 +1271,7 @@ int mutt_index_menu (void)
           menu->current = mutt_thread_next_unread (Context, CURHDR);
       }
 
-      if (option (OPTPGPAUTODEC) && 
-          (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
+      if (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))
         mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw);
 
       if ((op = mutt_display_message (CURHDR)) == -1) {
@@ -1297,7 +1292,7 @@ int mutt_index_menu (void)
       }
 
       if ((menu->menu == MENU_MAIN)
-          && (query_quadoption2(MCore.quit,
+          && (query_quadoption2(mod_core.quit,
                                 _("Exit Madmutt without saving?")) == M_YES))
       {
         if (Context) {
@@ -1967,8 +1962,7 @@ int mutt_index_menu (void)
 
       CHECK_MX_ACL (Context, ACL_INSERT, _("Editing"));
 
-      if (option (OPTPGPAUTODEC)
-          && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
+      if (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))
         mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw);
       mutt_edit_message (Context, tag ? NULL : CURHDR);
       menu->redraw = REDRAW_FULL;
@@ -1981,8 +1975,7 @@ int mutt_index_menu (void)
       CHECK_VISIBLE;
       CHECK_ATTACH;
 
-      if (option (OPTPGPAUTODEC) &&
-          (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) 
+      if (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))
         mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw);
       ci_send_message (SENDFORWARD, NULL, NULL, Context, tag ? NULL : CURHDR);
       menu->redraw = REDRAW_FULL;
@@ -1994,8 +1987,7 @@ int mutt_index_menu (void)
       CHECK_VISIBLE;
       CHECK_ATTACH;
 
-      if (option (OPTPGPAUTODEC) &&
-          (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) 
+      if (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))
         mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw);
 
       ci_send_message (SENDREPLY | SENDGROUPREPLY, NULL, NULL, Context,
@@ -2009,8 +2001,7 @@ int mutt_index_menu (void)
       CHECK_MSGCOUNT;
       CHECK_VISIBLE;
 
-      if (option (OPTPGPAUTODEC) &&
-          (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) 
+      if (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))
         mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw);
 
       ci_send_message (SENDREPLY | SENDLISTREPLY, NULL, NULL, Context,
@@ -2046,35 +2037,20 @@ int mutt_index_menu (void)
       break;
 
     case OP_PIPE:
-
       CHECK_MSGCOUNT;
       CHECK_VISIBLE;
       mutt_pipe_message (tag ? NULL : CURHDR);
-      /* in an IMAP folder index with imap_peek=no, piping could change
-       * * new or old messages status to read. Redraw what's needed.
-       */
-      if (Context->magic == M_IMAP && !option (OPTIMAPPEEK)) {
-        menu->redraw = (tag ? REDRAW_INDEX : REDRAW_CURRENT) | REDRAW_STATUS;
-      }
       MAYBE_REDRAW (menu->redraw);
       break;
 
     case OP_PRINT:
-
       CHECK_MSGCOUNT;
       CHECK_VISIBLE;
       mutt_print_message (tag ? NULL : CURHDR);
-      /* in an IMAP folder index with imap_peek=no, piping could change
-       * * new or old messages status to read. Redraw what's needed.
-       */
-      if (Context->magic == M_IMAP && !option (OPTIMAPPEEK)) {
-        menu->redraw = (tag ? REDRAW_INDEX : REDRAW_CURRENT) | REDRAW_STATUS;
-      }
       break;
 
     case OP_MAIN_READ_THREAD:
     case OP_MAIN_READ_SUBTHREAD:
-
       CHECK_MSGCOUNT;
       CHECK_VISIBLE;
       CHECK_READONLY;
@@ -2166,8 +2142,7 @@ int mutt_index_menu (void)
       CHECK_MSGCOUNT;
       CHECK_VISIBLE;
 
-      if (option (OPTPGPAUTODEC) &&
-          (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))) 
+      if (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED))
         mutt_check_traditional_pgp (tag ? NULL : CURHDR, &menu->redraw);
 
       ci_send_message (SENDREPLY, NULL, NULL, Context, tag ? NULL : CURHDR);