From 7fa6b3db3cebd6fa64684f1cd4535653501f22bb Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Thu, 3 Feb 2011 13:08:53 -0800 Subject: [PATCH] Give an error message if the APPEND wasn't successful. --- lisp/ChangeLog | 5 +++++ lisp/nnimap.el | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f2eccd69f..0eae50526 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-02-03 Lars Ingebrigtsen + + * nnimap.el (nnimap-request-accept-article): Give an error message if + the APPEND wasn't successful. + 2011-02-03 Adam Sjøgren * gnus-start.el (gnus-get-unread-articles): Fix the call to methods diff --git a/lisp/nnimap.el b/lisp/nnimap.el index e7c2f3251..b50d656aa 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -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 -- 2.25.1