Synch with Oort Gnus.
[elisp/gnus.git-] / lisp / nndraft.el
index 5f21751..57397fb 100644 (file)
@@ -1,5 +1,6 @@
 ;;; nndraft.el --- draft article access for Gnus
-;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000
+
+;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001
 ;;        Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
           (newest (if (file-newer-than-file-p file auto) file auto))
           (nntp-server-buffer (or buffer nntp-server-buffer)))
       (when (and (file-exists-p newest)
-                (let ((nnmail-file-coding-system nnheader-text-coding-system))
+                (let ((nnmail-file-coding-system
+                       (if (file-newer-than-file-p file auto)
+                           (if (equal group "drafts")
+                               message-draft-coding-system
+                             nnheader-text-coding-system)
+                         nnheader-auto-save-coding-system)))
                   (nnmail-find-file newest)))
        (save-excursion
          (set-buffer nntp-server-buffer)
   (when (nndraft-request-article article group server (current-buffer))
     (message-remove-header "xref")
     (message-remove-header "lines")
-    (message-remove-header "date")
+    ;; Articles in nndraft:queue are considered as sent messages.  The
+    ;; Date field should be the time when they are sent.
+    ;;(message-remove-header "date")
     t))
 
 (deffoo nndraft-request-update-info (group info &optional server)
       (dolist (n dir)
        (unless (file-exists-p
                 (setq file (expand-file-name (int-to-string n) pathname)))
-         (rename-file (let ((buffer-file-name file))
-                        (make-auto-save-file-name)) file)))))
+         (rename-file (nndraft-auto-save-file-name file) file)))))
   (nnoo-parent-function 'nndraft
                        'nnmh-request-group
                        (list group server dont-check)))