Don't alter message-text if decryption fails.
authorDaiki Ueno <ueno@unixuser.org>
Tue, 25 Apr 2006 09:01:31 +0000 (09:01 +0000)
committerDaiki Ueno <ueno@unixuser.org>
Tue, 25 Apr 2006 09:01:31 +0000 (09:01 +0000)
lisp/riece-epg.el

index e2a5af9..542bcd2 100644 (file)
           (cons #'riece-epg-passphrase-callback-function
                 (riece-message-target message)))
          (condition-case error
           (cons #'riece-epg-passphrase-callback-function
                 (riece-message-target message)))
          (condition-case error
-             (setq string (epg-decrypt-string context
-                                              (base64-decode-string string)))
+             (riece-message-set-text
+              message
+              (concat
+               "[OpenPGP Decrypted:"
+               (decode-coding-string
+                (epg-decrypt-string context (base64-decode-string string))
+                (if (consp coding-system)
+                    (car coding-system)
+                  coding-system))
+               "]"))
            (error
             (if (setq entry (riece-identity-assoc
                              (riece-message-target message)
                              riece-epg-passphrase-alist))
                 (setcdr entry nil))
            (error
             (if (setq entry (riece-identity-assoc
                              (riece-message-target message)
                              riece-epg-passphrase-alist))
                 (setcdr entry nil))
-            (message "%s" (cdr error))))
-         (riece-message-set-text
-          message
-          (decode-coding-string string
-                                (if (consp coding-system)
-                                    (car coding-system)
-                                  coding-system))))))
+            (message "%s" (cdr error)))))))
   message)
 
 (defun riece-epg-insinuate ()
   message)
 
 (defun riece-epg-insinuate ()