2001-11-07 Katsumi Yamaoka <yamaoka@jpl.org>
authorShengHuo ZHU <zsh@cs.rochester.edu>
Wed, 7 Nov 2001 11:18:55 +0000 (11:18 +0000)
committerShengHuo ZHU <zsh@cs.rochester.edu>
Wed, 7 Nov 2001 11:18:55 +0000 (11:18 +0000)
* message.el: Always require canlock.
(message-ignored-supersedes-headers): Include Cancel-Lock and
Cancel-Key.
(message-insert-canlock): Don't require canlock.
(message-cancel-news): Don't check whether canlock is available.
(message-supersede): Support cancel-locks.

* gnus-art.el: Don't autoload canlock.

lisp/ChangeLog
lisp/gnus-art.el
lisp/message.el

index 77e55be..c8e9da8 100644 (file)
@@ -1,3 +1,14 @@
+2001-11-07  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * message.el: Always require canlock.
+       (message-ignored-supersedes-headers): Include Cancel-Lock and
+       Cancel-Key.
+       (message-insert-canlock): Don't require canlock.
+       (message-cancel-news): Don't check whether canlock is available.
+       (message-supersede): Support cancel-locks.
+
+       * gnus-art.el: Don't autoload canlock.
+
 2001-11-06 18:00:00  ShengHuo ZHU  <zsh@cs.rochester.edu>
 
        * mail-source.el (mail-source-fetch-imap): ASYNC param.
index 0611b3b..6bc1a2c 100644 (file)
@@ -2900,8 +2900,6 @@ If variable `gnus-use-long-file-name' is non-nil, it is
                  (put-text-property (match-end 0) (point-max)
                                     'face eface)))))))))
 
-(autoload 'canlock-verify "canlock")
-
 (defun article-verify-cancel-lock ()
   "Verify Cancel-Lock header."
   (interactive)
index f765b36..7d75de7 100644 (file)
@@ -31,9 +31,9 @@
 ;;; Code:
 
 (eval-when-compile
-  (require 'canlock)
   (require 'cl)
   (defvar gnus-list-identifiers)) ; gnus-sum is required where necessary
+(require 'canlock)
 (require 'mailheader)
 (require 'nnheader)
 ;; This is apparently necessary even though things are autoloaded:
@@ -217,7 +217,7 @@ included.  Organization, Lines and User-Agent are optional."
   :group 'message-headers
   :type 'regexp)
 
-(defcustom message-ignored-supersedes-headers "^Path:\\|^Date\\|^NNTP-Posting-Host:\\|^Xref:\\|^Lines:\\|^Received:\\|^X-From-Line:\\|^X-Trace:\\|^X-Complaints-To:\\|Return-Path:\\|^Supersedes:\\|^NNTP-Posting-Date:\\|^X-Trace:\\|^X-Complaints-To:"
+(defcustom message-ignored-supersedes-headers "^Path:\\|^Date\\|^NNTP-Posting-Host:\\|^Xref:\\|^Lines:\\|^Received:\\|^X-From-Line:\\|^X-Trace:\\|^X-Complaints-To:\\|Return-Path:\\|^Supersedes:\\|^NNTP-Posting-Date:\\|^X-Trace:\\|^X-Complaints-To:\\|^Cancel-Lock:\\|^Cancel-Key:"
   "*Header lines matching this regexp will be deleted before posting.
 It's best to delete old Path and Date headers before posting to avoid
 any confusion."
@@ -2816,7 +2816,6 @@ Otherwise, generate and save a value for `canlock-password' first."
 
 (defun message-insert-canlock ()
   (when message-insert-canlock
-    (require 'canlock)
     (message-canlock-password)
     (canlock-insert-header)))
 
@@ -4528,21 +4527,16 @@ If ARG, allow editing of the cancellation message."
               ;; <abraham@dina.kvl.dk>
               ;;
               ;; 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
+              ;;   IF we can verify it THEN
+              ;;     issue cancel
               ;;   ELSE
-              ;;      error: message is cancel locked
+              ;;     error: cancellock: article is not yours
               ;; 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."))
+                  (if (null (canlock-verify))
+                      t
+                    (error "Failed to verify Cancel-lock: This article is not yours"))
                 nil)
               (message-gnksa-enable-p 'cancel-messages)
               (and sender
@@ -4588,7 +4582,23 @@ header line with the old Message-ID."
        (sender (message-fetch-field "sender"))
        (from (message-fetch-field "from")))
     ;; Check whether the user owns the article that is to be superseded.
-    (unless (or (message-gnksa-enable-p 'cancel-messages)
+    (unless (or
+            ;; Canlock-logic as suggested by Per Abrahamsen
+            ;; <abraham@dina.kvl.dk>
+            ;;
+            ;; IF article has cancel-lock THEN
+            ;;   IF we can verify it THEN
+            ;;     issue cancel
+            ;;   ELSE
+            ;;     error: cancellock: article is not yours
+            ;; ELSE
+            ;;   Use old rules, comparing sender...
+            (if (message-fetch-field "Cancel-Lock")
+                (if (null (canlock-verify))
+                    t
+                  (error "Failed to verify Cancel-lock: This article is not yours"))
+              nil)
+            (message-gnksa-enable-p 'cancel-messages)
                (and sender
                     (string-equal
                      (downcase sender)