emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/gnorb c280ea4 160/449: Only add relevant sent messages


From: Stefan Monnier
Subject: [elpa] externals/gnorb c280ea4 160/449: Only add relevant sent messages in the registry
Date: Fri, 27 Nov 2020 23:15:30 -0500 (EST)

branch: externals/gnorb
commit c280ea4835af2cc2d8ecc47fea58b6838628cfd1
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>

    Only add relevant sent messages in the registry
    
    * lisp/gnorb-gnus.el (gnorb-gnus-check-outgoing-headers): We were insert
      all the outgoing messages into the registry, which isn't right. We
      only need relevant ones -- with gnorb-id headers. Also, insert all
      such messages, even if we don't have a Gcc group. Better an incomplete
      entry than none at all.
---
 lisp/gnorb-gnus.el | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/lisp/gnorb-gnus.el b/lisp/gnorb-gnus.el
index 23c5e9c..b174332 100644
--- a/lisp/gnorb-gnus.el
+++ b/lisp/gnorb-gnus.el
@@ -265,14 +265,6 @@ information about the outgoing message into
           (link (or (and gcc
                          (org-store-link nil))
                     nil)))
-      ;; We want this message in the registry, if possible.
-      (when (and gnus-registry-enabled gcc)
-       (gnus-registry-insert gnus-registry-db msg-id
-                             (list (list 'creation-time (current-time))
-                                   (list 'group gcc)
-                                   (list 'sender from)
-                                   (list 'subject subject)))
-       (gnus-registry-set-id-key msg-id 'gnorb-ids org-ids))
       ;; If we can't make a real link, then save some information so
       ;; we can fake it.
       (when refs
@@ -289,7 +281,18 @@ information about the outgoing message into
            ;; if we're working from a draft, or triggering this from
            ;; a reply, it might not be there yet.
            (add-to-list 'message-exit-actions
-                        'gnorb-org-restore-after-send))
+                        'gnorb-org-restore-after-send)
+           ;; Relevant sent messages should be saved in the registry.
+           ;; If we have a full Gcc link, then we're good to go. If
+           ;; not, then just insert a registry entry with no group
+           ;; key, and figure it out later.
+           (when gnus-registry-enabled
+             (gnus-registry-insert gnus-registry-db msg-id
+                                   (list (list 'creation-time (current-time))
+                                         (list 'group gcc)
+                                         (list 'sender from)
+                                         (list 'subject subject)))
+             (gnus-registry-set-id-key msg-id 'gnorb-ids org-ids)))
        (setq gnorb-message-org-ids nil)))))
 
 (add-hook 'message-header-hook 'gnorb-gnus-check-outgoing-headers)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]