* wl.el (wl-toggle-plugged): Call `wl-biff-stop' if unplugged,
authorteranisi <teranisi>
Mon, 30 Oct 2000 04:24:12 +0000 (04:24 +0000)
committerteranisi <teranisi>
Mon, 30 Oct 2000 04:24:12 +0000 (04:24 +0000)
 `wl-biff-start' if plugged.

* wl-util.el (wl-biff-check-folder): New function.
(wl-biff-check-folders): Don't set session name prefix.
 Use `wl-biff-check-folder' instead of `wl-folder-check-one-entity'.
(wl-biff-check-folder-async): Ditto.

wl/ChangeLog
wl/wl-util.el
wl/wl.el

index b71045a..a264200 100644 (file)
@@ -1,5 +1,13 @@
 2000-10-30  Yuuichi Teranishi  <teranisi@gohome.org>
 
+       * wl.el (wl-toggle-plugged): Call `wl-biff-stop' if unplugged,
+       `wl-biff-start' if plugged.
+
+       * wl-util.el (wl-biff-check-folder): New function.
+       (wl-biff-check-folders): Don't set session name prefix.
+       Use `wl-biff-check-folder' instead of `wl-folder-check-one-entity'.
+       (wl-biff-check-folder-async): Ditto.
+
        * wl-address.el (wl-ldap-alias-safe-string): Replace '@' to '/'
        in email address.
 
index 831cbde..d0606d0 100644 (file)
@@ -840,7 +840,6 @@ This function is imported from Emacs 20.7."
       (message "Checking new mails..."))
     (let ((new-mails 0)
          (flist (or wl-biff-check-folder-list (list wl-default-folder)))
-         (elmo-network-session-name-prefix "BIFF-")
          folder)
       (if (eq (length flist) 1)
          (wl-biff-check-folder-async (car flist) (interactive-p))
@@ -851,10 +850,20 @@ This function is imported from Emacs 20.7."
              (when (elmo-folder-plugged-p folder)
                (setq new-mails
                      (+ new-mails
-                        (nth 0 (wl-folder-check-one-entity folder))))))
+                        (nth 0 (wl-biff-check-folder folder))))))
          (setq wl-biff-check-folders-running nil)
          (wl-biff-notify new-mails (interactive-p)))))))
 
+(defun wl-biff-check-folder (folder)
+  (if (eq (elmo-folder-get-type folder) 'pop3)
+      ;; pop3 biff should share the session.
+      (prog2
+         (elmo-commit folder) ; Close session.
+         (wl-folder-check-one-entity folder)
+       (elmo-commit folder))
+    (let ((elmo-network-session-name-prefix "BIFF-"))
+      (wl-folder-check-one-entity folder))))
+
 (defun wl-biff-check-folder-async-callback (diff data)
   (if (nth 1 data)
       (with-current-buffer (nth 1 data)
@@ -868,18 +877,20 @@ This function is imported from Emacs 20.7."
 
 (defun wl-biff-check-folder-async (folder notify-minibuf)
   (when (elmo-folder-plugged-p folder)
-    (if (and (eq (elmo-folder-get-type folder) 'imap4)
-            (wl-folder-use-server-diff-p folder))
-       ;; Check asynchronously only when IMAP4 and use server diff.
-       (progn
-         (setq elmo-folder-diff-async-callback
-               'wl-biff-check-folder-async-callback)
-         (setq elmo-folder-diff-async-callback-data
-               (list folder (get-buffer wl-folder-buffer-name)
-                     notify-minibuf))
-         (elmo-folder-diff-async folder))
-      (wl-biff-notify (car (wl-folder-check-one-entity folder))
-                     notify-minibuf)
+    (let ((type (elmo-folder-get-type folder)))
+      (if (and (eq type 'imap4)
+              (wl-folder-use-server-diff-p folder))
+         ;; Check asynchronously only when IMAP4 and use server diff.
+         (progn
+           (setq elmo-folder-diff-async-callback
+                 'wl-biff-check-folder-async-callback)
+           (setq elmo-folder-diff-async-callback-data
+                 (list folder (get-buffer wl-folder-buffer-name)
+                       notify-minibuf))
+           (let ((elmo-network-session-name-prefix "BIFF-"))
+             (elmo-folder-diff-async folder)))
+       (wl-biff-notify (car (wl-biff-check-folder folder))
+                       notify-minibuf))
       (setq wl-biff-check-folders-running nil))))
 
 ;;; wl-util.el ends here
index 588f5b6..3f58f0c 100644 (file)
--- a/wl/wl.el
+++ b/wl/wl.el
       (progn
        ;; flush queue!!
        (elmo-dop-queue-flush)
+       (wl-biff-start)
        (if (and wl-draft-enable-queuing
                 wl-auto-flush-queue)
            (wl-draft-queue-flush))
                  (wl-summary-flush-pending-append-operations seen-list))
            (elmo-msgdb-seen-save msgdb-dir seen-list)))
        (run-hooks 'wl-plugged-hook))
+    (wl-biff-stop)
     (run-hooks 'wl-unplugged-hook))
   (force-mode-line-update t))