(nnimap-get-flags): Use the same marks parsing code as the rest of nnimap.
[gnus] / lisp / nnimap.el
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)))