Give an error message if the APPEND wasn't successful.
authorLars Ingebrigtsen <larsi@gnus.org>
Thu, 3 Feb 2011 21:08:53 +0000 (13:08 -0800)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 3 Feb 2011 21:08:53 +0000 (13:08 -0800)
lisp/ChangeLog
lisp/nnimap.el

index f2eccd6..0eae505 100644 (file)
@@ -1,3 +1,8 @@
+2011-02-03  Lars Ingebrigtsen  <larsi@gnus.org>
+
+       * nnimap.el (nnimap-request-accept-article): Give an error message if
+       the APPEND wasn't successful.
+
 2011-02-03  Adam Sjøgren  <asjo@koldfront.dk>
 
        * gnus-start.el (gnus-get-unread-articles): Fix the call to methods
index e7c2f32..b50d656 100644 (file)
@@ -985,15 +985,20 @@ textual parts.")
                                 "\n"
                               "\r\n"))
        (let ((result (nnimap-get-response sequence)))
-         (if (not (car result))
+         (if (not (nnimap-ok-p result))
              (progn
-               (nnheader-message 7 "%s" (nnheader-get-report-string 'nnimap))
+               (nnheader-report 'nnimap "%s" result)
                nil)
            (cons group
                  (or (nnimap-find-uid-response "APPENDUID" (car result))
                      (nnimap-find-article-by-message-id
                       group message-id)))))))))
 
+(defun nnimap-ok-p (value)
+  (and (consp value)
+       (consp (car value))
+       (equal (caar value) "OK")))
+
 (defun nnimap-find-uid-response (name list)
   (let ((result (car (last (nnimap-find-response-element name list)))))
     (and result