nnimap-server-port.
(nnimap-request-article): Return the group/article number, so that Gnus
`^' works as expected.
+ (nnimap-find-wanted-parts-1): Return the MIME parts as IMAP wants
+ them.
* gnus.el (gnus-similar-server-opened): Refactor a bit and add
comments.
(cons group article))))))))
(defun nnimap-find-wanted-parts (structure)
- (let ((nnimap-level 1))
- (message-flatten-list (nnimap-find-wanted-parts-1 structure))))
+ (message-flatten-list (nnimap-find-wanted-parts-1 structure "")))
-(defun nnimap-find-wanted-parts-1 (structure)
- (let (levels)
+(defun nnimap-find-wanted-parts-1 (structure prefix)
+ (let ((num 1)
+ parts)
(while (consp (car structure))
(let ((sub (pop structure)))
(if (consp (car sub))
- (push (nnimap-find-wanted-parts-1 sub) levels)
+ (push (nnimap-find-wanted-parts-1
+ sub (if (string= prefix "")
+ (number-to-string num)
+ (format "%s.%s" prefix num)))
+ parts)
(let ((type (format "%s/%s" (nth 0 sub) (nth 1 sub))))
(when (string-match nnimap-fetch-partial-articles type)
- (push nnimap-level levels)))
- (incf nnimap-level))))
- (nreverse levels)))
+ (push (if (string= prefix "")
+ (number-to-string num)
+ (format "%s.%s" prefix num))
+ parts)))
+ (incf num))))
+ (nreverse parts)))
(deffoo nnimap-request-group (group &optional server dont-check info)
(with-current-buffer nntp-server-buffer