From: morioka Date: Sun, 24 Jan 1999 12:27:53 +0000 (+0000) Subject: (mime-find-entity-from-content-id): New function. X-Git-Tag: flim-1_12-199901241900~14 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=5094123fd7a2435fa03de8e3feed9614930cb005;p=elisp%2Fflim.git (mime-find-entity-from-content-id): New function. (mime-field-parser-alist): Use `mime-parse-msg-id' instead of `std11-parse-msg-id' to parse `Message-Id', `Recent-Message-Id' and `Content-Id' field. --- diff --git a/mime.el b/mime.el index 5f4fe72..fbfa0e4 100644 --- a/mime.el +++ b/mime.el @@ -53,6 +53,12 @@ and return parsed it.") "Read field-body of Content-Transfer-Encoding field from current-buffer, and return it.") +(autoload 'mime-parse-msg-id "mime-parse" + "Parse TOKENS as msg-id of Content-Id or Message-Id field.") + +(autoload 'mime-uri-parse-cid "mime-parse" + "Parse STRING as cid URI.") + (autoload 'mime-parse-buffer "mime-parse" "Parse BUFFER as a MIME message.") @@ -139,6 +145,21 @@ If MESSAGE is not specified, `mime-message-structure' is used." If MESSAGE is not specified, `mime-message-structure' is used." (mime-find-entity-from-number (reverse entity-node-id) message)) +(defun mime-find-entity-from-content-id (cid &optional message) + "Return entity from CID in MESSAGE. +If MESSAGE is not specified, `mime-message-structure' is used." + (or message + (setq message mime-message-structure)) + (if (equal cid (mime-read-field 'Content-Id message)) + message + (let ((children (mime-entity-children message)) + ret) + (while (and children + (null (setq ret (mime-find-entity-from-content-id + cid (car children))))) + (setq children (cdr children))) + ret))) + (defun mime-entity-parent (entity &optional message) "Return mother entity of ENTITY. If MESSAGE is specified, it is regarded as root entity." @@ -264,11 +285,13 @@ If MESSAGE is specified, it is regarded as root entity." (Bcc . std11-parse-addresses) (Resent-Bcc . std11-parse-addresses) - (Message-Id . std11-parse-msg-id) - (Recent-Message-Id . std11-parse-msg-id) + (Message-Id . mime-parse-msg-id) + (Recent-Message-Id . mime-parse-msg-id) (In-Reply-To . std11-parse-msg-ids) (References . std11-parse-msg-ids) + + (Content-Id . mime-parse-msg-id) )) (defun mime-read-field (field-name &optional entity)