add support for import key from gpgme as well !
[apps/madmutt.git] / lib-crypt / pgp.c
index 6b78ce4..8db2a5d 100644 (file)
@@ -167,7 +167,7 @@ static void pgp_copy_clearsigned (FILE * fpin, STATE * s, char *charset)
 
   rewind (fpin);
 
-  fc = fgetconv_open (fpin, charset, Charset, M_ICONV_HOOK_FROM);
+  fc = fgetconv_open (fpin, charset, MCharset.charset, M_ICONV_HOOK_FROM);
 
   for (complete = 1, armor_header = 1;
        fgetconvs (buf, sizeof (buf), fc) != NULL;
@@ -394,7 +394,7 @@ int pgp_application_pgp_handler (BODY * m, STATE * s)
 
         rewind (pgpout);
         state_set_prefix (s);
-        fc = fgetconv_open (pgpout, "utf-8", Charset, 0);
+        fc = fgetconv_open (pgpout, "utf-8", MCharset.charset, 0);
         while ((c = fgetconv (fc)) != EOF)
           state_prefix_putc (c, s);
         fgetconv_close (&fc);
@@ -609,8 +609,10 @@ static void pgp_extract_keys_from_attachment (FILE * fp, BODY * top)
 
   m_fclose(&tempfp);
 
-  pgp_invoke_import (tempfname);
-  mutt_any_key_to_continue (NULL);
+  if (CRYPT_MOD_CALL_CHECK (PGP, pgp_invoke_import)) {
+    (CRYPT_MOD_CALL (PGP, pgp_invoke_import)) (fname);
+    mutt_any_key_to_continue (NULL);
+  }
 
   mutt_unlink (tempfname);
 }
@@ -1268,7 +1270,7 @@ BODY *pgp_traditional_encryptsign (BODY * a, int flags, char *keylist)
   if (a->noconv)
     from_charset = body_charset;
   else
-    from_charset = Charset;
+    from_charset = MCharset.charset;
 
   if (!charset_is_us_ascii (body_charset)) {
     int c;