From a2ddb9ae9a3fab8974ecdf0703d307b8ce8cce0b Mon Sep 17 00:00:00 2001 From: Simon Josefsson Date: Sat, 20 Oct 2001 10:19:42 +0000 Subject: [PATCH] 2001-10-20 Simon Josefsson * message.el (message-cancel-news): Support cancel-locks. Suggested by Per Abrahamsson. --- lisp/ChangeLog | 3 +++ lisp/message.el | 39 ++++++++++++++++++++++++++++++--------- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d6f0f5b8d..963fb8441 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2001-10-20 Simon Josefsson + * message.el (message-cancel-news): Support cancel-locks. + Suggested by Per Abrahamsson. + * nnml.el (nnml-marks-changed-p): Use `equal' when comparing conses. From David Z Maze . diff --git a/lisp/message.el b/lisp/message.el index c9da66f78..ef462907c 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -4374,15 +4374,36 @@ If ARG, allow editing of the cancellation message." message-id (message-fetch-field "message-id" t) distribution (message-fetch-field "distribution"))) ;; Make sure that this article was written by the user. - (unless (or (message-gnksa-enable-p 'cancel-messages) - (and sender - (string-equal - (downcase sender) - (downcase (message-make-sender)))) - (string-equal - (downcase (cadr (mail-extract-address-components from))) - (downcase (cadr (mail-extract-address-components - (message-make-from)))))) + (unless (or + ;; Canlock-logic as suggested by Per Abrahamsen + ;; + ;; + ;; IF article has cancel-lock THEN + ;; IF we can load canlock THEN + ;; IF we can verify it THEN + ;; issue cancel + ;; ELSE + ;; error: cancellock: article is not yours + ;; ELSE + ;; error: message is cancel locked + ;; ELSE + ;; Use old rules, comparing sender... + (if (message-fetch-field "Cancel-Lock") + (if (ignore-errors (require 'canlock)) + (if (null (canlock-verify)) + t + (error "Failed to verify Cancel-lock: This article is not yours")) + (error "This article is cancel locked, the `canlock.el' library is required.")) + nil) + (message-gnksa-enable-p 'cancel-messages) + (and sender + (string-equal + (downcase sender) + (downcase (message-make-sender)))) + (string-equal + (downcase (cadr (mail-extract-address-components from))) + (downcase (cadr (mail-extract-address-components + (message-make-from)))))) (error "This article is not yours")) (when (yes-or-no-p "Do you really want to cancel this article? ") ;; Make control message. -- 2.25.1