branch: externals/gnorb
commit 850977345d02c1f331507a3152c4d121044e3418
Author: Eric Abrahamsen <[email protected]>
Commit: Stefan Monnier <[email protected]>
Don't let the Gnus summary format group create registry entries
* packages/gnorb/gnorb-gnus.el (gnorb-gnus-insert-format-letter-maybe):
This function was unilaterally creating entries because of its use
of `gnus-regsitry-get-id-key'. Because it does not respect ignored
registry groups, we should use lower-level functions that don't
create an entry where there wasn't one.
---
gnorb-gnus.el | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/gnorb-gnus.el b/gnorb-gnus.el
index e682391..5a75bc0 100644
--- a/gnorb-gnus.el
+++ b/gnorb-gnus.el
@@ -749,15 +749,20 @@ option `gnorb-gnus-hint-relevant-article' is non-nil."
(add-hook 'gnus-select-article-hook 'gnorb-gnus-hint-relevant-message)
(defun gnorb-gnus-insert-format-letter-maybe (header)
- (if (not (memq (car (gnus-find-method-for-group
- gnus-newsgroup-name))
- '(nnvirtual nnir)))
- (cond ((gnus-registry-get-id-key
- (mail-header-message-id header) 'gnorb-ids)
- gnorb-gnus-summary-tracked-mark)
- ((gnorb-find-tracked-headings header)
- gnorb-gnus-summary-mark)
- (t " "))
+ (if (not (or (gnus-ephemeral-group-p gnus-newsgroup-name)
+ (gnus-virtual-group-p gnus-newsgroup-name)))
+ (let* ((id (mail-header-message-id header))
+ ;; Use lower-level accessor to avoid creating an entry
+ ;; where there wasn't one. This function doesn't respect
+ ;; ignored registry groups.
+ (entry (nth 1 (assoc id (registry-lookup
+ gnus-registry-db
+ (list id))))))
+ (cond ((cdr-safe (assq 'gnorb-ids entry))
+ gnorb-gnus-summary-tracked-mark)
+ ((gnorb-find-tracked-headings header)
+ gnorb-gnus-summary-mark)
+ (t " ")))
" "))
(fset (intern (concat "gnus-user-format-function-"