- server backend-group)
- (setq server (nnir-group-server group))
- (setq backend-group (gnus-group-real-name group))
- (gnus-group-read-ephemeral-group
- backend-group
- (gnus-server-to-method server)
- t ; activate
- (cons (current-buffer)
- 'summary) ; window config
- nil
- (list backend-number))
- (gnus-summary-limit (list backend-number))
- (gnus-summary-refer-thread)))
+ (id (mail-header-id (gnus-summary-article-header)))
+ (refs (split-string
+ (mail-header-references (gnus-summary-article-header)))))
+ (if (string= (car (gnus-group-method group)) "nnimap")
+ (with-current-buffer (nnimap-buffer)
+ (let* ((cmd (let ((value
+ (format
+ "(OR HEADER REFERENCES %s HEADER Message-Id %s)"
+ id id)))
+ (dolist (refid refs value)
+ (setq value (format
+ "(OR (OR HEADER Message-Id %s HEADER REFERENCES %s) %s)"
+ refid refid value)))))
+ (result (nnimap-command
+ "UID SEARCH %s" cmd)))
+ (gnus-summary-read-group-1 group t t gnus-summary-buffer nil
+ (and (car result)
+ (delete 0 (mapcar #'string-to-number
+ (cdr (assoc "SEARCH" (cdr result)))))))))
+ (gnus-summary-read-group-1 group t t gnus-summary-buffer
+ nil (list backend-number))
+ (gnus-summary-limit (list backend-number))
+ (gnus-summary-refer-thread))))
+