2000-10-01 20:55:53 ShengHuo ZHU <zsh@cs.rochester.edu>
authorShengHuo ZHU <zsh@cs.rochester.edu>
Mon, 2 Oct 2000 00:06:58 +0000 (00:06 +0000)
committerShengHuo ZHU <zsh@cs.rochester.edu>
Mon, 2 Oct 2000 00:06:58 +0000 (00:06 +0000)
Don't postpone GCC if none of GCC methods is agent-covered.  This
fix presumes that the post-method must be agent-covered if any Gcc
method is agent-covered.

* gnus-msg.el (gnus-inews-group-method): New function.
(gnus-inews-do-gcc): Use it.
* gnus-agent.el (gnus-agent-any-covered-gcc): New function.
(gnus-agent-possibly-save-gcc): Use it.
(gnus-agent-possibly-do-gcc): Ditto.

lisp/ChangeLog
lisp/gnus-agent.el
lisp/gnus-msg.el

index 90b5562..c8d97ce 100644 (file)
@@ -1,3 +1,15 @@
+2000-10-01 20:55:53  ShengHuo ZHU  <zsh@cs.rochester.edu>
+
+       Don't postpone GCC if none of GCC methods is agent-covered.  This
+       fix presumes that the post-method must be agent-covered if any Gcc
+       method is agent-covered.
+
+       * gnus-msg.el (gnus-inews-group-method): New function.
+       (gnus-inews-do-gcc): Use it.
+       * gnus-agent.el (gnus-agent-any-covered-gcc): New function.
+       (gnus-agent-possibly-save-gcc): Use it.
+       (gnus-agent-possibly-do-gcc): Ditto.
+
 2000-10-01 17:08:50  ShengHuo ZHU  <zsh@cs.rochester.edu>
 
        * mailcap.el (mailcap-mime-types): Use mailcap-mime-data.
index 13dfeab..0e12697 100644 (file)
@@ -384,10 +384,26 @@ be a select method."
     (goto-char (point-min))
     (while (re-search-forward (concat gnus-agent-gcc-header ":") nil t)
       (replace-match "Gcc:" 'fixedcase))))
-  
+
+(defun gnus-agent-any-covered-gcc ()
+  (save-restriction
+    (message-narrow-to-headers)
+    (let* ((gcc (mail-fetch-field "gcc" nil t))
+          (methods (and gcc 
+                        (mapcar 'gnus-inews-group-method
+                                (message-unquote-tokens
+                                 (message-tokenize-header 
+                                  gcc " ,")))))
+          covered)
+      (while (and (not covered) methods)
+       (setq covered
+             (member (car methods) gnus-agent-covered-methods)
+             methods (cdr methods)))
+      covered)))
+
 (defun gnus-agent-possibly-save-gcc ()
   "Save GCC if Gnus is unplugged."
-  (unless gnus-plugged
+  (when (and (not gnus-plugged) (gnus-agent-any-covered-gcc))
     (save-excursion
       (goto-char (point-min))
       (let ((case-fold-search t))
@@ -396,7 +412,7 @@ be a select method."
 
 (defun gnus-agent-possibly-do-gcc ()
   "Do GCC if Gnus is plugged."
-  (when gnus-plugged
+  (when (or gnus-plugged (not (gnus-agent-any-covered-gcc)))
     (gnus-inews-do-gcc)))
 
 ;;;
index a49258d..8210579 100644 (file)
@@ -1041,6 +1041,21 @@ this is a reply."
 
 ;;; Gcc handling.
 
+(defun gnus-inews-group-method (group)
+  (cond ((and (null (gnus-get-info group))
+             (eq (car gnus-message-archive-method)
+                 (car
+                  (gnus-server-to-method
+                   (gnus-group-method group)))))
+        ;; If the group doesn't exist, we assume
+        ;; it's an archive group...
+        gnus-message-archive-method)
+       ;; Use the method.
+       ((gnus-info-method (gnus-get-info group))
+        (gnus-info-method (gnus-get-info group)))
+       ;; Find the method.
+       (t (gnus-group-method group))))
+
 ;; Do Gcc handling, which copied the message over to some group.
 (defun gnus-inews-do-gcc (&optional gcc)
   (interactive)
@@ -1059,21 +1074,7 @@ this is a reply."
            ;; Copy the article over to some group(s).
            (while (setq group (pop groups))
              (gnus-check-server
-              (setq method
-                    (cond ((and (null (gnus-get-info group))
-                                (eq (car gnus-message-archive-method)
-                                    (car
-                                     (gnus-server-to-method
-                                      (gnus-group-method group)))))
-                           ;; If the group doesn't exist, we assume
-                           ;; it's an archive group...
-                           gnus-message-archive-method)
-                          ;; Use the method.
-                          ((gnus-info-method (gnus-get-info group))
-                           (gnus-info-method (gnus-get-info group)))
-                          ;; Find the method.
-                          (t (gnus-group-method group)))))
-             (gnus-check-server method)
+              (setq method (gnus-inews-group-method group)))
              (unless (gnus-request-group group t method)
                (gnus-request-create-group group method))
              (save-excursion