(mime-bbdb/update-record): Use `mime-entity-fetch-field' and
authormorioka <morioka>
Fri, 19 Jun 1998 19:18:00 +0000 (19:18 +0000)
committermorioka <morioka>
Fri, 19 Jun 1998 19:18:00 +0000 (19:18 +0000)
`mime-entity-read-field'.

mime-bbdb.el

index 002942a..23d4fb3 100644 (file)
@@ -160,17 +160,20 @@ the user confirms the creation."
         (set-buffer mime-preview-buffer))
     (if bbdb-use-pop-up
         (mime-bbdb/pop-up-bbdb-buffer offer-to-create)
-      (let* ((from (std11-field-body "From"))
-             (addr (if from
-                      (car (cdr (mail-extract-address-components from))))))
-        (if (or (null from)
-                (null addr)
-                (string-match (bbdb-user-mail-names) addr))
-            (setq from (or (std11-field-body "To") from))
+      (let* ((message (get-text-property (point-min) 'mime-view-entity))
+            (from (mime-entity-fetch-field message 'From))
+            addr)
+       (if (or (null from)
+                (null
+                (setq addr (car (mime-entity-read-field message 'From))))
+                (string-match (bbdb-user-mail-names)
+                             (std11-address-string addr)))
+            (setq from (or (mime-entity-fetch-field message 'To)
+                          from))
          )
         (if from
             (bbdb-annotate-message-sender
-             from t
+             (eword-decode-structured-field-body from) t
              (or (bbdb-invoke-hook-for-value mime-bbdb/auto-create-p)
                  offer-to-create)
              offer-to-create))