]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix up < and > "date" scoring rules in Gnus
authorAlex Bochannek <alex@bochannek.com>
Thu, 10 Sep 2020 13:16:04 +0000 (15:16 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 10 Sep 2020 13:16:04 +0000 (15:16 +0200)
* lisp/gnus/gnus-score.el (gnus-score-date): The previous < and >
"date" scoring rules (added in the previous patch) had reversed
logic (bug#43270).

Copyright-paperwork-exempt: yes

lisp/gnus/gnus-score.el

index c5156a195a37f2994e8aa8d9f284766ea3c8413c..6a0e8ceb99869eb63dc47c8d34aa1c53667e6315 100644 (file)
@@ -1695,9 +1695,10 @@ score in `gnus-newsgroup-scored' by SCORE."
                  match (gnus-date-iso8601 (nth 0 kill))))
           ((eq type '<)
            (setq type 'after
-                 match-func 'gnus-string>
+                 match-func 'string<
                  match (gnus-time-iso8601
-                        (time-add (current-time) (* 86400 (nth 0 kill))))))
+                        (time-subtract (current-time)
+                                       (* 86400 (nth 0 kill))))))
           ((eq type 'before)
            (setq match-func 'gnus-string>
                  match (gnus-date-iso8601 (nth 0 kill))))
@@ -1705,7 +1706,8 @@ score in `gnus-newsgroup-scored' by SCORE."
            (setq type 'before
                  match-func 'gnus-string>
                  match (gnus-time-iso8601
-                        (time-add (current-time) (* -86400 (nth 0 kill))))))
+                        (time-subtract (current-time)
+                                       (* 86400 (nth 0 kill))))))
           ((eq type 'at)
            (setq match-func 'string=
                  match (gnus-date-iso8601 (nth 0 kill))))