- (let ((gnus-newsgroup-dependencies (make-vector 10 nil))
- headers)
- (setq headers
- (if (eq 'nov
- (gnus-retrieve-headers
- (setq articles
- (gnus-uncompress-range
- (cons
- (if active (1+ (cdr active)) (car gactive))
- (cdr gactive))))
- group))
- (gnus-get-newsgroup-headers-xover articles)
- (gnus-get-newsgroup-headers)))
- (while headers
- ;; We take a closer look on all articles that have
- ;; "@@NCM" in the subject.
- (when (string-match "@@NCM" (mail-header-subject (car headers)))
- (gnus-nocem-check-article
- (mail-header-number (car headers)) group))
- (setq headers (cdr headers)))))))
+ (save-excursion
+ (let ((dependencies (make-vector 10 nil))
+ headers header)
+ (nnheader-temp-write nil
+ (setq headers
+ (if (eq 'nov
+ (gnus-retrieve-headers
+ (setq articles
+ (gnus-uncompress-range
+ (cons
+ (if active (1+ (cdr active))
+ (car gactive))
+ (cdr gactive))))
+ group))
+ (gnus-get-newsgroup-headers-xover
+ articles nil dependencies)
+ (gnus-get-newsgroup-headers dependencies)))
+ (while (setq header (pop headers))
+ ;; We take a closer look on all articles that have
+ ;; "@@NCM" in the subject. Unless we already read
+ ;; this cross posted message. Nocem messages
+ ;; are not allowed to have references, so we can
+ ;; ignore scanning followups.
+ (and (string-match "@@NCM" (mail-header-subject header))
+ (or gnus-nocem-liberal-fetch
+ (and (or (string= "" (mail-header-references
+ header))
+ (null (mail-header-references header)))
+ (not (member (mail-header-message-id header)
+ gnus-nocem-seen-message-ids))))
+ (gnus-nocem-check-article group header)))))))
+ (setq gnus-nocem-active
+ (cons (list group gactive)
+ (delq (assoc group gnus-nocem-active)
+ gnus-nocem-active)))))