(nnimap-get-flags): Use the same marks parsing code as the rest of nnimap.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sat, 9 Oct 2010 15:56:52 +0000 (17:56 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sat, 9 Oct 2010 15:56:52 +0000 (17:56 +0200)
lisp/ChangeLog
lisp/nnimap.el

index 45052d1..121b9f0 100644 (file)
@@ -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  <julien@danjou.info>
 
index 7d3fedb..c11e30a 100644 (file)
@@ -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)))