From: Lars Magne Ingebrigtsen Date: Sat, 9 Oct 2010 15:56:52 +0000 (+0200) Subject: (nnimap-get-flags): Use the same marks parsing code as the rest of nnimap. X-Git-Url: http://cgit.sxemacs.org/?p=gnus;a=commitdiff_plain;h=f553da2f2970e179fbbf10d91dd33278f06ca76b (nnimap-get-flags): Use the same marks parsing code as the rest of nnimap. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 45052d130..121b9f0aa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -4,6 +4,8 @@ try to use that for the tls stream. (nnimap-retrieve-group-data-early): Rework the marks code to heed UIDVALIDITY and find out which groups are read-only and not. + (nnimap-get-flags): Use the same marks parsing code as the rest of + nnimap. 2010-10-09 Julien Danjou diff --git a/lisp/nnimap.el b/lisp/nnimap.el index 7d3fedb2f..c11e30a2f 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -667,16 +667,19 @@ textual parts.") (defun nnimap-get-flags (spec) (let ((articles nil) - elems) + elems end) (with-current-buffer (nnimap-buffer) (erase-buffer) (nnimap-wait-for-response (nnimap-send-command "UID FETCH %s FLAGS" spec)) + (setq end (point)) + (subst-char-in-region (point-min) (point-max) + ?\\ ?% t) (goto-char (point-min)) - (while (re-search-forward "^\\* [0-9]+ FETCH (\\(.*\\))" nil t) - (setq elems (nnimap-parse-line (match-string 1))) - (push (cons (string-to-number (cadr (member "UID" elems))) - (cadr (member "FLAGS" elems))) + (while (search-forward " FETCH " end t) + (setq elems (read (current-buffer))) + (push (cons (cadr (memq 'UID elems)) + (cadr (memq 'FLAGS elems))) articles))) (nreverse articles)))