(Use commented out line).
(elmo-imap4-rename-folder): Ditto.
* elmo-dop.el (elmo-dop-queue-append): Use `elmo-string' to get folder string
itself.
(elmo-dop-list-deleted): New function.
(elmo-dop-list-folder): Treat result of `elmo-dop-list-deleted' as killed.
* elmo-util.el (elmo-string-rassoc-all): New function.
+2000-11-28 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * elmo-imap4.el (elmo-imap4-delete-folder):
+ Send "close" before "delete" (Use commented out line).
+ (elmo-imap4-rename-folder): Ditto.
+
+ * elmo-dop.el (elmo-dop-queue-append): Use `elmo-string' to get
+ folder string itself.
+ (elmo-dop-list-deleted): New function.
+ (elmo-dop-list-folder): Treat result of `elmo-dop-list-deleted' as
+ killed.
+
+ * elmo-util.el (elmo-string-rassoc-all): New function.
+
2000-11-26 Kenichi OKADA <okada@opaopa.org>
* elmo-nntp.el (elmo-network-initialize-session): Accept response 20[01].
Automatically loaded/saved.")
(defun elmo-dop-queue-append (folder function argument)
- (let ((operation (list (format "%s" folder) function argument)))
+ (let ((operation (list (elmo-string folder) function argument)))
(elmo-dop-queue-load)
(unless (member operation elmo-dop-queue) ;; don't append same operation
(setq elmo-dop-queue
(setq numbers (cdr numbers)))
(cons appended deleting-msgids)))
+(defun elmo-dop-list-deleted (folder number-alist)
+ "List message numbers to be deleted on FOLDER from NUMBER-ALIST."
+ (elmo-dop-queue-load)
+ (let ((queue elmo-dop-queue)
+ numbers matches nalist)
+ (while queue
+ (if (and (string= (nth 0 (car queue)) folder)
+ (string= (nth 1 (car queue)) "delete-msgids"))
+ (setq numbers
+ (nconc numbers
+ (delq nil (mapcar
+ (lambda (x)
+ (mapcar 'car
+ (elmo-string-rassoc-all
+ x number-alist)))
+ (nth 2 (car queue)))))))
+ (setq queue (cdr queue)))
+ (elmo-uniq-list (elmo-flatten numbers))))
+
(defun elmo-dop-delete-msgs (folder msgs msgdb)
(save-match-data
(let ((folder-numbers (elmo-make-folder-numbers-list folder msgs))
alreadies
max-num
(i 0))
+ (setq killed (nconc (elmo-dop-list-deleted folder number-alist)
+ killed))
(while append-list
(if (rassoc (car append-list) number-alist)
(setq alreadies (append alreadies
(if (eq (elmo-folder-get-type folder) 'imap4)
(if elmo-enable-disconnected-operation
(let* ((number-alist (elmo-msgdb-number-load
- (elmo-msgdb-expand-path folder)))
+ (elmo-msgdb-expand-path folder)))
(number-list (mapcar 'car number-alist))
(append-list (elmo-dop-append-list-load folder))
(append-num (length append-list))
(when (elmo-imap4-spec-mailbox spec)
(when (setq msgs (elmo-imap4-list-folder spec))
(elmo-imap4-delete-msgs spec msgs))
- ;; (elmo-imap4-send-command-wait session "close")
+ (elmo-imap4-send-command-wait session "close")
(elmo-imap4-send-command-wait
session
(list "delete "
(elmo-imap4-mailbox (elmo-imap4-spec-mailbox spec)))))))
(defun elmo-imap4-rename-folder (old-spec new-spec)
-;;;(elmo-imap4-send-command-wait session "close")
- (elmo-imap4-send-command-wait
- (elmo-imap4-get-session old-spec)
- (list "rename "
- (elmo-imap4-mailbox
- (elmo-imap4-spec-mailbox old-spec))
- " "
- (elmo-imap4-mailbox
- (elmo-imap4-spec-mailbox new-spec)))))
-
+ (let ((session (elmo-imap4-get-session old-spec)))
+ (elmo-imap4-send-command-wait session "close")
+ (elmo-imap4-send-command-wait
+ session
+ (list "rename "
+ (elmo-imap4-mailbox
+ (elmo-imap4-spec-mailbox old-spec))
+ " "
+ (elmo-imap4-mailbox
+ (elmo-imap4-spec-mailbox new-spec))))))
+
(defun elmo-imap4-max-of-folder (spec)
(let ((session (elmo-imap4-get-session spec))
(killed (and elmo-use-killed-list
(throw 'loop a))
(setq alist (cdr alist))))))
+(defun elmo-string-rassoc-all (key alist)
+ (let (matches)
+ (while alist
+ (if (string= key (cdr (car alist)))
+ (setq matches
+ (cons (car alist)
+ matches)))
+ (setq alist (cdr alist)))
+ matches))
+
;;; Number set defined by OKAZAKI Tetsurou <okazaki@be.to>
;;
;; number ::= [0-9]+