mu-scm: add support for thread-id

Code + doc + test
This commit is contained in:
Dirk-Jan C. Binnema
2025-06-28 12:21:19 +03:00
parent cc39c9cae6
commit f2699a4b95
3 changed files with 38 additions and 6 deletions

View File

@ -41,6 +41,8 @@
subject
references
thread-id
mailing-list
language
@ -223,6 +225,15 @@ fake-message-id (see impls) are filtered out. If there are no references, return
#f."
(find-field message ':references))
(define-method (thread-id (message <message>))
"Get the oldest (first) reference for MESSAGE, or message-id if there are none.
If neither are available, return #f.
This is method is useful to determine the thread a message is in."
(let ((refs (references message)))
(if (and refs (not (null? refs)))
(car refs)
(message-id message))))
(define-method (mailing-list (message <message>))
"Get the mailing-list id for MESSAGE or #f if not available."
(find-field message ':list))