[gnus git] branch master updated: =2= (nnimap-process-quirk): Renamed function to avoid collision. ; (nnimap-quirk): Add quirk for Gmail IMAP which bugs out on NUL characters.

Lars Ingebrigtsen <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  6c7c716a21493485a47f4ca081c01c3c4c1ee5fc (commit)
       via  328bdcc7ef80844d091a42062f46952b8458367f (commit)
      from  530c9fe9d00f3eb2e8ab4fee30d7161fd3fbb78d (commit)


- Log -----------------------------------------------------------------
commit 6c7c716a21493485a47f4ca081c01c3c4c1ee5fc
Author: Lars Ingebrigtsen <[email protected]>
Date:   Mon Feb 7 02:50:47 2011 -0800

    (nnimap-process-quirk): Renamed function to avoid collision.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 488e133..a49f3ae 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -5,6 +5,7 @@
 	(nnimap-update-info): Clean up slightly.
 	(nnimap-quirk): Add quirk for Gmail IMAP which bugs out on NUL
 	characters.
+	(nnimap-process-quirk): Renamed function to avoid collision.
 
 2011-02-06  Lars Ingebrigtsen  <[email protected]>
 
diff --git a/lisp/nnimap.el b/lisp/nnimap.el
index 47a64c0..4ca7e7f 100644
--- a/lisp/nnimap.el
+++ b/lisp/nnimap.el
@@ -969,7 +969,7 @@ textual parts.")
       (nnimap-add-cr)
       (setq message (buffer-substring-no-properties (point-min) (point-max)))
       (with-current-buffer (nnimap-buffer)
-	(when (setq message (nnimap-quirk "OK Gimap " 'append message))
+	(when (setq message (nnimap-process-quirk "OK Gimap " 'append message))
 	  ;; If we have this group open read-only, then unselect it
 	  ;; before appending to it.
 	  (when (equal (nnimap-examined nnimap-object) group)
@@ -995,7 +995,7 @@ textual parts.")
 			(nnimap-find-article-by-message-id
 			 group message-id))))))))))
 
-(defun nnimap-quirk (greeting-match type data)
+(defun nnimap-process-quirk (greeting-match type data)
   (when (and (nnimap-greeting nnimap-object)
 	     (string-match "OK Gimap " (nnimap-greeting nnimap-object))
 	     (eq type 'append)

commit 328bdcc7ef80844d091a42062f46952b8458367f
Author: Lars Ingebrigtsen <[email protected]>
Date:   Mon Feb 7 02:48:55 2011 -0800

    (nnimap-quirk): Add quirk for Gmail IMAP which bugs out on NUL characters.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 73bee4b..488e133 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -3,6 +3,8 @@
 	* nnimap.el (nnimap-update-info): Refactor slightly.
 	(nnimap-update-info): Tell Gnus whether there are any \Recent messages.
 	(nnimap-update-info): Clean up slightly.
+	(nnimap-quirk): Add quirk for Gmail IMAP which bugs out on NUL
+	characters.
 
 2011-02-06  Lars Ingebrigtsen  <[email protected]>
 
diff --git a/lisp/nnimap.el b/lisp/nnimap.el
index 6de49eb..47a64c0 100644
--- a/lisp/nnimap.el
+++ b/lisp/nnimap.el
@@ -969,6 +969,7 @@ textual parts.")
       (nnimap-add-cr)
       (setq message (buffer-substring-no-properties (point-min) (point-max)))
       (with-current-buffer (nnimap-buffer)
+	(when (setq message (nnimap-quirk "OK Gimap " 'append message))
 	;; If we have this group open read-only, then unselect it
 	;; before appending to it.
 	(when (equal (nnimap-examined nnimap-object) group)
@@ -992,7 +993,30 @@ textual parts.")
 	    (cons group
 		  (or (nnimap-find-uid-response "APPENDUID" (car result))
 		      (nnimap-find-article-by-message-id
-		       group message-id)))))))))
+			 group message-id))))))))))
+
+(defun nnimap-quirk (greeting-match type data)
+  (when (and (nnimap-greeting nnimap-object)
+	     (string-match "OK Gimap " (nnimap-greeting nnimap-object))
+	     (eq type 'append)
+	     (string-match "\000" data))
+    (let ((choice (gnus-multiple-choice
+		   "Message contains NUL characters.  Delete, continue, abort? "
+		   '((?d "Delete NUL characters")
+		     (?c "Try to APPEND the message as is")
+		     (?a "Abort")))))
+      (cond
+       ((eq choice ?a)
+	(nnheader-report 'nnimap "Aborted APPEND due to NUL characters"))
+       ((eq choice ?c)
+	data)
+       (t
+	(with-temp-buffer
+	  (insert data)
+	  (goto-char (point-min))
+	  (while (search-forward "\000" nil t)
+	    (replace-match "" t t))
+	  (buffer-string)))))))
 
 (defun nnimap-ok-p (value)
   (and (consp value)

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog |    3 ++
 lisp/nnimap.el |   72 +++++++++++++++++++++++++++++++++++++------------------
 2 files changed, 51 insertions(+), 24 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.