*** empty log message ***
[gnus] / lisp / nnvirtual.el
index 80ec3cd..59dacdc 100644 (file)
@@ -35,7 +35,7 @@
 
 \f
 
-(defconst nnvirtual-version "nnvirtual 0.0"
+(defconst nnvirtual-version "nnvirtual 1.0"
   "Version number of this version of nnvirtual.")
 
 (defvar nnvirtual-group-alist nil)
@@ -51,7 +51,7 @@
 
 ;;; Interface functions.
 
-(defun nnvirtual-retrieve-headers (sequence &optional newsgroup server)
+(defun nnvirtual-retrieve-headers (sequence &optional newsgroup server fetch-old)
   "Retrieve the headers for the articles in SEQUENCE."
   (nnvirtual-possibly-change-newsgroups newsgroup server t)
   (save-excursion
@@ -85,6 +85,7 @@
                                 (gnus-find-method-for-group group))
                           (and (or (gnus-server-opened group-method)
                                    (gnus-open-server group-method))
+                               (gnus-request-group group t)
                                (gnus-retrieve-headers articles group)))))
              (save-excursion
                (set-buffer nntp-server-buffer)
          (let ((unfetched (gnus-sorted-complement 
                            articles (nreverse fetched-articles))))
            (and unfetched
-                (gnus-group-make-articles-read group unfetched nil))))
+                (gnus-group-make-articles-read group unfetched))))
        ;; The headers are ready for reading, so they are inserted into
        ;; the nntp-server-buffer, which is where Gnus expects to find
        ;; them.
@@ -210,6 +211,12 @@ If the stream is opened, return T, otherwise return NIL."
        (setq nnvirtual-status-string "No component groups")
        (setq nnvirtual-current-group nil)
        nil))))
+
+(defun nnvirtual-request-type (group &optional article)
+  (nnvirtual-possibly-change-newsgroups group nil)
+  (if (not article)
+      'unknown
+    (gnus-request-type (car (nnvirtual-art-group article)))))
     
 (defun nnvirtual-close-group (group &optional server)
   (if (not nnvirtual-current-group)
@@ -236,27 +243,19 @@ If the stream is opened, return T, otherwise return NIL."
        "nnvirtual: LIST NEWSGROUPS is not implemented.")
   nil)
 
-(defalias 'nnvirtual-request-post 'nntp-request-post)
-
-(defun nnvirtual-request-post-buffer 
-  (post group subject header article-buffer info follow-to respect-poster)
-  (nntp-request-post-buffer post "" subject header article-buffer
-                           info follow-to respect-poster))
-
 \f
 ;;; Internal functions.
 
-;; Convert HEAD headers into NOV headers.
 (defun nnvirtual-convert-headers ()
+  "Convert HEAD headers into NOV headers."
   (save-excursion
     (set-buffer nntp-server-buffer)
-    (let* ((gnus-newsgroup-dependencies (make-vector 100 0))
-          (headers (gnus-get-newsgroup-headers))
+    (let* ((dependencies (make-vector 100 0))
+          (headers (gnus-get-newsgroup-headers dependencies))
           header)
       (erase-buffer)
       (while headers
-       (setq header (car headers)
-             headers (cdr headers))
+       (setq header (pop headers))
        (insert (int-to-string (mail-header-number header)) "\t"
                (or (mail-header-subject header) "") "\t"
                (or (mail-header-from header) "") "\t"
@@ -335,9 +334,9 @@ If the stream is opened, return T, otherwise return NIL."
            ()
          ;; And then we do the mapping for this component group. If
          ;; you feel tempted to cast your eyes to the soup below -
-         ;; don't. It'll hurt your soul. Suffice to say that it
+         ;; don't.  It'll hurt your soul.  Suffice to say that it
          ;; assigns ranges of nnvirtual article numbers to the
-         ;; different component groups. To get the article number
+         ;; different component groups.  To get the article number
          ;; from the nnvirtual number, one does something like
          ;; (+ (- number offset) (car active)), where `offset' is the
          ;; slice the mess below assigns, and active is the lowest