From 6542116e332d6dac4fd5d43946532c5524e92e4d Mon Sep 17 00:00:00 2001 From: Teodor Zlatanov Date: Thu, 6 Nov 2003 21:27:10 +0000 Subject: [PATCH] * spam.el (spam-mark-spam-as-expired-and-move-routine) (spam-ham-copy-or-move-routine): prevent article deletions or moves unless the backend allows it * spam.el (spam-spamoracle): doc change --- lisp/ChangeLog | 4 ++++ lisp/spam.el | 24 +++++++++++++++++------- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 52990ede3..de0b984e8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2003-11-06 Teodor Zlatanov suggested by Jean-Marc Lasgouttes + * spam.el (spam-mark-spam-as-expired-and-move-routine) + (spam-ham-copy-or-move-routine): prevent article deletions or + moves unless the backend allows it + * gnus.el (gnus-install-group-spam-parameters): fixed parameters to list spamoracle as well diff --git a/lisp/spam.el b/lisp/spam.el index 73796a802..783cc2e75 100644 --- a/lisp/spam.el +++ b/lisp/spam.el @@ -561,6 +561,9 @@ spamoracle database." (defun spam-mark-spam-as-expired-and-move-routine (&rest groups) (gnus-summary-kill-process-mark) (let ((articles gnus-newsgroup-articles) + (backend-supports-deletions + (gnus-check-backend-function + 'request-move-article gnus-newsgroup-name)) article tomove deletep) (dolist (article articles) (when (eq (gnus-summary-article-mark article) gnus-spam-mark) @@ -574,14 +577,16 @@ spamoracle database." (dolist (article tomove) (gnus-summary-set-process-mark article)) (when tomove - (if (> (length groups) 1) + (if (or (not backend-supports-deletions) + (> (length groups) 1)) (progn (gnus-summary-copy-article nil group) (setq deletep t)) (gnus-summary-move-article nil group))))) - ;; now delete the articles, if there was a copy done - (when deletep + ;; now delete the articles, if there was a copy done, and the + ;; backend allows it + (when (and deletep backend-supports-deletions) (dolist (article tomove) (gnus-summary-set-process-mark article)) (when tomove @@ -593,6 +598,9 @@ spamoracle database." (defun spam-ham-copy-or-move-routine (copy groups) (gnus-summary-kill-process-mark) (let ((articles gnus-newsgroup-articles) + (backend-supports-deletions + (gnus-check-backend-function + 'request-move-article gnus-newsgroup-name)) article mark todo deletep) (dolist (article articles) (when (spam-group-ham-mark-p gnus-newsgroup-name @@ -607,16 +615,18 @@ spamoracle database." (gnus-summary-mark-article article gnus-unread-mark)) (gnus-summary-set-process-mark article)) - (if (> (length groups) 1) + (if (or (not backend-supports-deletions) + (> (length groups) 1)) (progn (gnus-summary-copy-article nil group) (setq deletep t)) (gnus-summary-move-article nil group)))) - - ;; now delete the articles, unless a) copy is t, and when there was a copy done + + ;; now delete the articles, unless a) copy is t, and there was a copy done ;; b) a move was done to a single group + ;; c) backend-supports-deletions is nil (unless copy - (when deletep + (when (and deletep backend-supports-deletions) (dolist (article todo) (gnus-summary-set-process-mark article)) (when todo -- 2.34.1