Clean buffy.c and init.c
[apps/madmutt.git] / lib-crypt / crypt-gpgme.c
index 2711dd7..c5c6986 100644 (file)
@@ -34,7 +34,6 @@
 #include <lib-ui/enter.h>
 #include <lib-ui/menu.h>
 
-#include "mutt.h"
 #include "lib.h"
 #include "alias.h"
 #include <lib-crypt/crypt.h>
@@ -43,6 +42,7 @@
 #include "pager.h"
 #include "recvattach.h"
 #include "sort.h"
+#include "crypt-gpgme.h"
 
 /*
  * Helper macros.
@@ -3503,7 +3503,7 @@ static crypt_key_t *crypt_getkeybyaddr (address_t * a, short abilities,
 }
 
 
-static crypt_key_t *crypt_getkeybystr (char *p, short abilities,
+static crypt_key_t *crypt_getkeybystr (const char *p, short abilities,
                                        unsigned int app, int *forced_valid)
 {
   string_list_t *hints = NULL;
@@ -3617,7 +3617,8 @@ static crypt_key_t *crypt_ask_for_key (char *tag,
 static char *find_keys (address_t * to, address_t * cc, address_t * bcc,
                         unsigned int app)
 {
-  char *keyID, *keylist = NULL, *t;
+  char *keylist = NULL, *t;
+  const char *keyID;
   ssize_t keylist_size = 0;
   ssize_t keylist_used = 0;
   address_t *tmp = NULL, *addr = NULL;
@@ -3677,13 +3678,8 @@ static char *find_keys (address_t * to, address_t * cc, address_t * bcc,
           q = addr;
         }
         else {
-#if 0
-          k_info = crypt_getkeybystr (keyID, KEYFLAG_CANENCRYPT,
-                                      *r_application, &forced_valid);
-#else
           k_info = crypt_getkeybystr (keyID, KEYFLAG_CANENCRYPT,
                                       app, &forced_valid);
-#endif
         }
       }
       else if (r == -1) {
@@ -3700,11 +3696,7 @@ static char *find_keys (address_t * to, address_t * cc, address_t * bcc,
       snprintf (buf, sizeof (buf), _("Enter keyID for %s: "), q->mailbox);
 
       if ((key = crypt_ask_for_key (buf, q->mailbox, KEYFLAG_CANENCRYPT,
-#if 0
-                                    *r_application,
-#else
                                     app,
-#endif
                                     &forced_valid)) == NULL) {
         p_delete(&keylist);
         address_list_wipe(&tmp);
@@ -3718,13 +3710,6 @@ static char *find_keys (address_t * to, address_t * cc, address_t * bcc,
     {
       const char *s = crypt_fpr (key);
 
-#if 0
-      if (key->flags & KEYFLAG_ISX509)
-        *r_application &= ~APPLICATION_PGP;
-      if (!(key->flags & KEYFLAG_ISX509))
-        *r_application &= ~APPLICATION_SMIME;
-#endif
-
       keylist_size += m_strlen(s) + 4 + 1;
       p_realloc(&keylist, keylist_size);
       sprintf (keylist + keylist_used, "%s0x%s%s",      /* __SPRINTF_CHECKED__ */
@@ -3818,11 +3803,6 @@ static int gpgme_send_menu (HEADER * msg, int *redraw, int is_smime)
 
       msg->security |= (is_smime ? SMIMESIGN : PGPSIGN);
     }
-#if 0
-    else {
-      msg->security &= (is_smime ? ~SMIMESIGN : ~PGPSIGN);
-    }
-#endif
     *redraw = REDRAW_FULL;
     break;