Don't alter message-text if decryption fails.
authorueno <ueno>
Tue, 25 Apr 2006 09:01:31 +0000 (09:01 +0000)
committerueno <ueno>
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
-             (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))
-            (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 ()