* modb-standard.el (elmo-msgdb-append-entity): If entity or
authorhmurata <hmurata>
Tue, 11 Nov 2003 00:52:24 +0000 (00:52 +0000)
committerhmurata <hmurata>
Tue, 11 Nov 2003 00:52:24 +0000 (00:52 +0000)
message-id is nil do nothing.

elmo/ChangeLog
elmo/modb-standard.el

index 3eea7a6..108bc31 100644 (file)
@@ -1,6 +1,11 @@
+2003-11-11  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
+
+       * modb-standard.el (elmo-msgdb-append-entity): If entity or
+       message-id is nil do nothing.
+
 2003-11-10  Yuuichi Teranishi  <teranisi@gohome.org>
 
-       * elmo-imap4.el (elmo-imap4-disuse-server-flag-mailbox-regexp): 
+       * elmo-imap4.el (elmo-imap4-disuse-server-flag-mailbox-regexp):
        Revival.
        (elmo-imap4-session): Removed use-flag slot.
        (elmo-imap4-session-select-mailbox): Undo last change.
index 23d2580..5a60da4 100644 (file)
 
 (luna-define-method elmo-msgdb-append-entity ((msgdb modb-standard)
                                              entity &optional flags)
-  (let ((number (elmo-msgdb-message-entity-number
-                (elmo-message-entity-handler entity) entity))
-       (msg-id (elmo-msgdb-message-entity-field
-                (elmo-message-entity-handler entity) entity 'message-id))
-       duplicate)
-    ;; number-list
-    (modb-standard-set-number-list-internal
-     msgdb
-     (nconc (modb-standard-number-list-internal msgdb)
-           (list number)))
-    ;; entity-map
-    (let ((table (modb-standard-entity-map msgdb)))
-      (setq duplicate (elmo-get-hash-val msg-id table))
-      (elmo-set-hash-val (modb-standard-key number) entity table)
-      (elmo-set-hash-val msg-id entity table))
-    ;; modification flags
-    (modb-standard-set-message-modified msgdb number)
-    ;; flag-map
-    (when flags
-      (elmo-set-hash-val
-       (modb-standard-key number)
-       (cons number flags)
-       (modb-standard-flag-map msgdb))
-      (modb-standard-countup-flags msgdb flags)
-      (modb-standard-set-flag-modified msgdb number))
-    duplicate))
+  (when entity
+    (let ((number (elmo-msgdb-message-entity-number
+                  (elmo-message-entity-handler entity) entity))
+         (msg-id (elmo-msgdb-message-entity-field
+                  (elmo-message-entity-handler entity) entity 'message-id))
+         duplicate)
+      (when msg-id
+       ;; number-list
+       (modb-standard-set-number-list-internal
+        msgdb
+        (nconc (modb-standard-number-list-internal msgdb)
+               (list number)))
+       ;; entity-map
+       (let ((table (modb-standard-entity-map msgdb)))
+         (setq duplicate (elmo-get-hash-val msg-id table))
+         (elmo-set-hash-val (modb-standard-key number) entity table)
+         (elmo-set-hash-val msg-id entity table))
+       ;; modification flags
+       (modb-standard-set-message-modified msgdb number)
+       ;; flag-map
+       (when flags
+         (elmo-set-hash-val
+          (modb-standard-key number)
+          (cons number flags)
+          (modb-standard-flag-map msgdb))
+         (modb-standard-countup-flags msgdb flags)
+         (modb-standard-set-flag-modified msgdb number))
+       duplicate))))
 
 (luna-define-method elmo-msgdb-delete-messages ((msgdb modb-standard)
                                                numbers)