* riece-commands.el (riece-command-enter-message): Fix behavior at last line of buffer.
[riece] / lisp / riece-epg.el
index df66fa6..a33d8ad 100644 (file)
@@ -32,6 +32,7 @@
 (autoload 'epg-encrypt-string "epg")
 (autoload 'epg-passphrase-callback-function "epg")
 (autoload 'epg-context-set-passphrase-callback "epg")
+(autoload 'epg-cancel "epg")
 
 (eval-when-compile
   (autoload 'riece-command-send-message "riece-commands"))
              t)))
     (riece-display-message
      (riece-make-message (riece-current-nickname) riece-current-channel
-                        (concat "[decrypted:" string "]") nil t))
-    (let ((next-line-add-newlines t))
-      (next-line 1))))
+                        (concat "[encrypted:" string "]") nil t))
+    (if (> (forward-line) 0)
+       (insert "\n"))))
 
 (defun riece-command-set-passphrase (identity passphrase)
   "Set PASSPHRASE associated with IDENTITY."
              (progn
                (riece-message-set-text
                 message
-                (format "[decrypted:%s]"
+                (format "[encrypted:%s]"
                         (riece-epg-decrypt-string-for-identity
                          context string (riece-message-target message)))))
            (error
       (delete-region from to)
       (save-excursion
        (goto-char from)
-       (insert "[decrypted:" plain "]")))))
+       (insert "[encrypted:" plain "]")))))
 
 (defun riece-epg-requires ()
   (if (memq 'riece-button riece-addons)