From 1e23a60a2bdd2fe38d1c4a76bdd5a879d5fc0c8d Mon Sep 17 00:00:00 2001 From: Simon Josefsson Date: Sun, 25 Jun 2000 09:53:37 +0000 Subject: [PATCH] message.el (message-unquote-tokens): New function. gnus-msg.el (gnus-inews-do-gcc): Unquote gcc tokens. nnimap.el (nnimap-request-post): Ditto. --- lisp/gnus-msg.el | 3 ++- lisp/message.el | 14 ++++++++++++-- lisp/nnimap.el | 6 +++--- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/lisp/gnus-msg.el b/lisp/gnus-msg.el index e094a4d3c..85d765cb2 100644 --- a/lisp/gnus-msg.el +++ b/lisp/gnus-msg.el @@ -1037,7 +1037,8 @@ this is a reply." (when gcc (message-remove-header "gcc") (widen) - (setq groups (message-tokenize-header gcc " ,")) + (setq groups (message-unquote-tokens + (message-tokenize-header gcc " ,"))) ;; Copy the article over to some group(s). (while (setq group (pop groups)) (gnus-check-server diff --git a/lisp/message.el b/lisp/message.el index a2a6156e1..41777b683 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -1032,9 +1032,19 @@ should be sent in several parts. If it is nil, the size is unlimited." `(delete-region (progn (beginning-of-line) (point)) (progn (forward-line ,(or n 1)) (point)))) +(defun message-unquote-tokens (elems) + "Remove leading and trailing double quotes (\") from quoted strings +in list." + (mapcar (lambda (item) + (if (string-match "^\"\\(.*\\)\"$" item) + (match-string 1 item) + item)) + elems)) + (defun message-tokenize-header (header &optional separator) "Split HEADER into a list of header elements. -\",\" is used as the separator." +SEPARATOR is a string of characters to be used as separators. \",\" +is used by default." (if (not header) nil (let ((regexp (format "[%s]+" (or separator ","))) @@ -1064,7 +1074,7 @@ should be sent in several parts. If it is nil, the size is unlimited." ((and (eq (char-after) ?\)) (not quoted)) (setq paren nil)))) - (nreverse elems))))) + (nreverse elems))))) (defun message-mail-file-mbox-p (file) "Say whether FILE looks like a Unix mbox file." diff --git a/lisp/nnimap.el b/lisp/nnimap.el index 26bf473aa..b83361a90 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -37,7 +37,6 @@ ;; Todo, minor things: ;; ;; o Don't require half of Gnus -- backends should be standalone -;; o Support escape characters in `message-tokenize-header' ;; o Verify that we don't use IMAP4rev1 specific things (RFC2060 App B) ;; o Dont uid fetch 1,* in nnimap-retrive-groups (slow) ;; o Split up big fetches (1,* header especially) in smaller chunks @@ -741,8 +740,9 @@ function is generally only called when Gnus is shutting down." (deffoo nnimap-request-post (&optional server) (let ((success t)) - (dolist (mbx (message-tokenize-header - (message-fetch-field "Newsgroups")) success) + (dolist (mbx (message-unquote-tokens + (message-tokenize-header + (message-fetch-field "Newsgroups") ", ") success)) (let ((to-newsgroup (gnus-group-prefixed-name mbx gnus-command-method))) (or (gnus-active to-newsgroup) (gnus-activate-group to-newsgroup) -- 2.25.1