2003-09-05 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
+ * elmo-shimbun.el (elmo-shimbun-folder-entity-hash): Use
+ `elmo-folder-list-message-entities' instead of
+ `elmo-msgdb-get-overview'.
+ (elmo-map-folder-list-message-locations): Ditto.
+
+ * elmo-msgdb.el (elmo-msgdb-append): Rewrite (use interface
+ methods instead of treat directly).
+ (elmo-msgdb-clear): Ditto.
+ (elmo-msgdb-delete-msgs): Ditto.
+ (elmo-msgdb-sort-by-date): Ditto.
+
+ * elmo-nntp.el (elmo-nntp-msgdb-create-message): Removed unused
+ local variables.
+ (elmo-nntp-folder-msgdb-create): Follow the API change.
+
* elmo-version.el (elmo-version): Up to 2.11.10.
2003-08-30 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
(elmo-msgdb-overview-get-entity
number msgdb)))))
-(defsubst elmo-msgdb-append (msgdb msgdb-append)
- (list
- (nconc (car msgdb) (car msgdb-append))
- (nconc (cadr msgdb) (cadr msgdb-append))
- (nconc (caddr msgdb) (caddr msgdb-append))
- (elmo-msgdb-make-index-return
- msgdb
- (elmo-msgdb-get-overview msgdb-append)
- (elmo-msgdb-get-mark-alist msgdb-append))
- (nth 4 msgdb)))
+(defun elmo-msgdb-append (msgdb msgdb-append)
+ "Return a list of messages which have duplicated message-id."
+ (let (duplicates)
+ (elmo-msgdb-set-overview
+ msgdb
+ (nconc (elmo-msgdb-get-overview msgdb)
+ (elmo-msgdb-get-overview msgdb-append)))
+ (elmo-msgdb-set-number-alist
+ msgdb
+ (nconc (elmo-msgdb-get-number-alist msgdb)
+ (elmo-msgdb-get-number-alist msgdb-append)))
+ (elmo-msgdb-set-mark-alist
+ msgdb
+ (nconc (elmo-msgdb-get-mark-alist msgdb)
+ (elmo-msgdb-get-mark-alist msgdb-append)))
+ (setq duplicates (elmo-msgdb-make-index
+ msgdb
+ (elmo-msgdb-get-overview msgdb-append)
+ (elmo-msgdb-get-mark-alist msgdb-append)))
+ (elmo-msgdb-set-path
+ msgdb
+ (or (elmo-msgdb-get-path msgdb)
+ (elmo-msgdb-get-path msgdb-append)))
+ duplicates))
(defun elmo-msgdb-merge (folder msgdb-merge)
"Return a list of messages which have duplicated message-id."
(defsubst elmo-msgdb-clear (&optional msgdb)
(if msgdb
- (list
- (setcar msgdb nil)
- (setcar (cdr msgdb) nil)
- (setcar (cddr msgdb) nil)
- (setcar (nthcdr 3 msgdb) nil)
- (setcar (nthcdr 4 msgdb) nil))
- (list nil nil nil nil nil)))
+ (progn
+ (elmo-msgdb-set-overview msgdb nil)
+ (elmo-msgdb-set-number-alist msgdb nil)
+ (elmo-msgdb-set-mark-alist msgdb nil)
+ (elmo-msgdb-set-index msgdb nil)
+ msgdb)
+ (elmo-make-msgdb)))
(defun elmo-msgdb-delete-msgs (msgdb msgs)
"Delete MSGS from MSGDB
;;
(when index (elmo-msgdb-clear-index msgdb ov-entity))
(setq msgs (cdr msgs)))
- (setcar msgdb overview)
- (setcar (cdr msgdb) number-alist)
- (setcar (cddr msgdb) mark-alist)
- (setcar (nthcdr 3 msgdb) index)
+ (elmo-msgdb-set-overview msgdb overview)
+ (elmo-msgdb-set-number-alist msgdb number-alist)
+ (elmo-msgdb-set-mark-alist msgdb mark-alist)
+ (elmo-msgdb-set-index msgdb index)
t)) ;return value
(defun elmo-msgdb-sort-by-date (msgdb)
(message "Sorting...")
(let ((overview (elmo-msgdb-get-overview msgdb)))
- (setq overview (elmo-msgdb-overview-sort-by-date overview))
+ (elmo-msgdb-set-overview
+ msgdb
+ (elmo-msgdb-overview-sort-by-date overview))
(message "Sorting...done")
- (list overview (nth 1 msgdb)(nth 2 msgdb))))
+ msgdb))
;;;
(defsubst elmo-msgdb-append-element (list element)
(defun elmo-nntp-folder-msgdb-create (folder numbers flag-table)
(let ((filter numbers)
(session (elmo-nntp-get-session folder))
+ (new-msgdb (elmo-make-msgdb))
beg-num end-num cur length
- ret-val ov-str use-xover dir)
+ new-msgdb ov-str use-xover dir)
(elmo-nntp-select-group session (elmo-nntp-folder-group-internal
folder))
(when (setq use-xover (elmo-nntp-xover-p session))
elmo-nntp-overview-fetch-chop-length))))
(with-current-buffer (elmo-network-session-buffer session)
(if ov-str
- (setq ret-val
- (elmo-msgdb-append
- ret-val
- (elmo-nntp-create-msgdb-from-overview-string
- ov-str
- flag-table
- filter
- )))))
+ (elmo-msgdb-append
+ new-msgdb
+ (elmo-nntp-create-msgdb-from-overview-string
+ ov-str
+ flag-table
+ filter))))
(if (null (elmo-nntp-read-response session t))
(progn
(setq cur end-num);; exit while loop
(elmo-display-progress
'elmo-nntp-msgdb-create "Getting overview..." 100)))
(if (not use-xover)
- (setq ret-val (elmo-nntp-msgdb-create-by-header
- session numbers flag-table))
+ (setq new-msgdb (elmo-nntp-msgdb-create-by-header
+ session numbers flag-table))
(with-current-buffer (elmo-network-session-buffer session)
(if ov-str
- (setq ret-val
- (elmo-msgdb-append
- ret-val
- (elmo-nntp-create-msgdb-from-overview-string
- ov-str
- flag-table
- filter))))))
+ (elmo-msgdb-append
+ new-msgdb
+ (elmo-nntp-create-msgdb-from-overview-string
+ ov-str
+ flag-table
+ filter)))))
(elmo-folder-set-killed-list-internal
folder
(nconc
(elmo-folder-killed-list-internal folder)
(car (elmo-list-diff
numbers
- (elmo-msgdb-list-messages ret-val)))))
+ (elmo-msgdb-list-messages new-msgdb)))))
;; If there are canceled messages, overviews are not obtained
;; to max-number(inn 2.3?).
(when (and (elmo-nntp-max-number-precedes-list-active-p)
(elmo-nntp-set-list-active session nil)
(error "NNTP list command failed")))
(elmo-nntp-catchup-msgdb
- ret-val
+ new-msgdb
(nth 1 (read (concat "(" (elmo-nntp-read-contents
session) ")")))))
- ret-val))
+ new-msgdb))
(luna-define-method elmo-folder-update-number ((folder elmo-nntp-folder))
(if (elmo-nntp-max-number-precedes-list-active-p)
(defun elmo-nntp-msgdb-create-message (len flag-table)
(save-excursion
(let ((new-msgdb (elmo-make-msgdb))
- beg overview number-alist mark-alist
- entity i num gmark seen message-id)
+ beg entity i num gmark message-id)
(elmo-set-buffer-multibyte nil)
(goto-char (point-min))
(setq i 0)
(defun elmo-shimbun-folder-entity-hash (folder)
(or (elmo-shimbun-folder-entity-hash-internal folder)
- (let ((overviews (elmo-msgdb-get-overview (elmo-folder-msgdb folder)))
+ (let ((overviews (elmo-folder-list-message-entities folder))
hash id)
(when overviews
(setq hash (elmo-make-hash (length overviews)))
))
t))
(elmo-msgdb-overview-entity-get-id ov)))
- (elmo-msgdb-get-overview (elmo-folder-msgdb folder))))
+ (elmo-folder-list-message-entities folder)))
(mapcar
(lambda (header)
(or (elmo-shimbun-header-extra-field header "x-shimbun-id")