]> granicus.if.org Git - neomutt/commitdiff
Add ~V to match successfully verified messages.
authorThomas Roessler <roessler@does-not-exist.org>
Mon, 28 Jan 2002 22:30:09 +0000 (22:30 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Mon, 28 Jan 2002 22:30:09 +0000 (22:30 +0000)
commands.c
menu.c
mutt.h
mutt_curses.h
pattern.c

index 2c8f5df4778aed1dbbdb62f934935bd3c923859a..d9bcb7190c899f992ade6ecadea53d637a98d6f7 100644 (file)
@@ -173,9 +173,12 @@ int mutt_display_message (HEADER *cur)
     mutt_any_key_to_continue (NULL);
 
 #if defined(HAVE_PGP) || defined(HAVE_SMIME)
-  /* update PGP information for this message */
+  /* update crypto information for this message */
   cur->security |= crypt_query (cur->content);
-
+  
+  /* Remove color cache for this message, in case there
+     are color patterns for both ~g and ~V */
+  cur->pair = 0;
 #endif
 
   if (builtin)
diff --git a/menu.c b/menu.c
index 4a1c46e6e745dfc4ed2cea1aa28ce80c502ead24..32df80b194bc0836446f5ef31c2e6682f78d4192 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -232,7 +232,8 @@ void menu_redraw_index (MUTTMENU *menu)
 
        if (i == menu->current)
        {
-         SETCOLOR (MT_COLOR_INDICATOR);
+          attrset (menu->color (i));
+         ADDCOLOR (MT_COLOR_INDICATOR);
          addstr ("->");
           attrset (menu->color (i));
          addch (' ');
@@ -245,14 +246,14 @@ void menu_redraw_index (MUTTMENU *menu)
       }
       else
       {
+        attrset (menu->color (i));
+            
        if (i == menu->current)
        {
-         SETCOLOR (MT_COLOR_INDICATOR);
+         ADDCOLOR (MT_COLOR_INDICATOR);
          BKGDSET (MT_COLOR_INDICATOR);
        }
-        else
-          attrset (menu->color (i));
-            
+
        CLEARLINE (i - menu->top + menu->offset);
        print_enriched_string (menu->color(i), (unsigned char *) buf, i != menu->current);
         SETCOLOR (MT_COLOR_NORMAL);
@@ -297,7 +298,8 @@ void menu_redraw_motion (MUTTMENU *menu)
 
     /* now draw it in the new location */
     move (menu->current + menu->offset - menu->top, 0);
-    SETCOLOR (MT_COLOR_INDICATOR);
+    attrset (menu->color (menu->current));
+    ADDCOLOR (MT_COLOR_INDICATOR);
     addstr ("->");
     SETCOLOR (MT_COLOR_NORMAL);
   }
@@ -313,7 +315,8 @@ void menu_redraw_motion (MUTTMENU *menu)
     /* now draw the new one to reflect the change */
     menu_make_entry (buf, sizeof (buf), menu, menu->current);
     menu_pad_string (buf, sizeof (buf));
-    SETCOLOR (MT_COLOR_INDICATOR);
+    attrset (menu->color (menu->current));
+    ADDCOLOR (MT_COLOR_INDICATOR);
     BKGDSET (MT_COLOR_INDICATOR);
     CLEARLINE (menu->current - menu->top + menu->offset);
     print_enriched_string (menu->color(menu->current), (unsigned char *) buf, 0);
@@ -336,7 +339,8 @@ void menu_redraw_current (MUTTMENU *menu)
     int attr = menu->color (menu->current);
     attrset (attr);
     clrtoeol ();
-    SETCOLOR (MT_COLOR_INDICATOR);
+    attrset (menu->color (menu->current));
+    ADDCOLOR (MT_COLOR_INDICATOR);
     addstr ("->");
     attrset (attr);
     addch (' ');
@@ -346,7 +350,8 @@ void menu_redraw_current (MUTTMENU *menu)
   }
   else
   {
-    SETCOLOR (MT_COLOR_INDICATOR);
+    attrset (menu->color (menu->current));
+    ADDCOLOR (MT_COLOR_INDICATOR);
     BKGDSET (MT_COLOR_INDICATOR);
     clrtoeol ();
     print_enriched_string (menu->color(menu->current), (unsigned char *) buf, 0);
diff --git a/mutt.h b/mutt.h
index a3f8902e1b8635aaaa2cfba7cb90acb28729d87a..f4136d90e6b14dbe416cfc0569b6378450501ab1 100644 (file)
--- a/mutt.h
+++ b/mutt.h
@@ -216,9 +216,12 @@ enum
   M_PERSONAL_RECIP,
   M_PERSONAL_FROM,
   M_ADDRESS,
+#if defined (HAVE_PGP) || defined (HAVE_SMIME)
+  M_CRYPT_SIGN,
+  M_CRYPT_VERIFIED,
+  M_CRYPT_ENCRYPT,
+#endif
 #ifdef HAVE_PGP
-  M_PGP_SIGN,
-  M_PGP_ENCRYPT,
   M_PGP_KEY,
 #endif
   M_XLABEL,
index 08af2163e5e273d5d16e4343cfcf1fc1501f5a38..c2322bd4d8989afc9aa2ae19b469493e7b69d1f6 100644 (file)
@@ -145,6 +145,7 @@ void ci_init_color (void);
 void ci_start_color (void);
 
 #define SETCOLOR(X) attrset(ColorDefs[X])
+#define ADDCOLOR(X) attron(ColorDefs[X])
 
 #define MAYBE_REDRAW(x) if (option (OPTNEEDREDRAW)) { unset_option (OPTNEEDREDRAW); x = REDRAW_FULL; }
 
index 2f0335e8f0b7bf33955d1a3130dcac10910e2861..a85fd48b21cd1709e34424950b8247ef70b01d0e 100644 (file)
--- a/pattern.c
+++ b/pattern.c
@@ -65,9 +65,9 @@ Flags[] =
   { 'E', M_EXPIRED,            0,              NULL },
   { 'f', M_FROM,               0,              eat_regexp },
   { 'F', M_FLAG,               0,              NULL },
-#ifdef HAVE_PGP
-  { 'g', M_PGP_SIGN,           0,              NULL },
-  { 'G', M_PGP_ENCRYPT,        0,              NULL },
+#if defined (HAVE_PGP) || defined (HAVE_SMIME)
+  { 'g', M_CRYPT_SIGN,                 0,              NULL },
+  { 'G', M_CRYPT_ENCRYPT,      0,              NULL },
 #endif
   { 'h', M_HEADER,             M_FULL_MSG,     eat_regexp },
   { 'i', M_ID,                 0,              eat_regexp },
@@ -91,6 +91,9 @@ Flags[] =
   { 't', M_TO,                 0,              eat_regexp },
   { 'U', M_UNREAD,             0,              NULL },
   { 'v', M_COLLAPSED,          0,              NULL },
+#if defined (HAVE_PGP) || defined (HAVE_SMIME)
+  { 'V', M_CRYPT_VERIFIED,      0,              NULL },
+#endif
   { 'x', M_REFERENCE,          0,              eat_regexp },
   { 'y', M_XLABEL,             0,              eat_regexp },
   { 'z', M_SIZE,               0,              eat_range },
@@ -1035,7 +1038,7 @@ mutt_pattern_exec (struct pattern_t *pat, pattern_exec_flag flags, CONTEXT *ctx,
                                        pat->alladdr, 4, h->env->from,
                                        h->env->sender, h->env->to, h->env->cc));
     case M_RECIPIENT:
-      return (pat->not ^ match_adrlist (pat->rx, flags & M_MATCH_FULL_ADDRESS,
+           return (pat->not ^ match_adrlist (pat->rx, flags & M_MATCH_FULL_ADDRESS,
                                        pat->alladdr, 2, h->env->to, h->env->cc));
     case M_LIST:
       return (pat->not ^ mutt_is_list_recipient (pat->alladdr, h->env->to, h->env->cc));
@@ -1045,11 +1048,15 @@ mutt_pattern_exec (struct pattern_t *pat, pattern_exec_flag flags, CONTEXT *ctx,
       return (pat->not ^ match_user (pat->alladdr, h->env->from, NULL));
     case M_COLLAPSED:
       return (pat->not ^ (h->collapsed && h->num_hidden > 1));
+#if defined (HAVE_PGP) || defined (HAVE_SMIME)
+   case M_CRYPT_SIGN:
+     return (pat->not ^ h->security & SIGN);
+   case M_CRYPT_VERIFIED:
+     return (pat->not ^ h->security & GOODSIGN);
+   case M_CRYPT_ENCRYPT:
+     return (pat->not ^ h->security & ENCRYPT);
+#endif
 #ifdef HAVE_PGP
-   case M_PGP_SIGN:
-     return (pat->not ^ (h->security & APPLICATION_PGP && h->security & SIGN));
-   case M_PGP_ENCRYPT:
-     return (pat->not ^ (h->security & APPLICATION_PGP && h->security & ENCRYPT));
    case M_PGP_KEY:
      return (pat->not ^ (h->security & APPLICATION_PGP && h->security & PGPKEY));
 #endif