From 5094123fd7a2435fa03de8e3feed9614930cb005 Mon Sep 17 00:00:00 2001 From: morioka Date: Sun, 24 Jan 1999 12:27:53 +0000 Subject: [PATCH] (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. --- mime.el | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) 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) -- 1.7.10.4