-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
guile: Fix the mu:body message method
Somewhere along the way, the body-txt and body-html fields were merged into a single body field. Later, commit 8eac392 ("guile: re-enable the guile support") finally removed support for Field::Id::BodyHtml from mu:c:get-field. Unfortunately mu.scm and the documentation are still stuck in the past, so update them. mu:body-txt is now a synonym for mu:body, and mu:body-html always returns #f. I wanted to add a mu:body test also for the rfc822.1 message, but there's currently a bug where its body text is is duplicated (issue #2802), so the test would fail.
- Loading branch information
Showing
4 changed files
with
33 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,6 +84,22 @@ exec guile -e main -s $0 $@ | |
(str-equal-or-exit (mu:to msg) "Democritus <[email protected]>") | ||
(str-equal-or-exit (mu:from msg) "Richard P. Feynman <[email protected]>") | ||
;;(str-equal-or-exit (mu:header msg "Content-Transfer-Encoding") "8bit") | ||
(str-equal-or-exit (mu:body msg) | ||
(string-join | ||
'("If, in some cataclysm, all scientific knowledge were to be destroyed," | ||
"and only one sentence passed on to the next generation of creatures," | ||
"what statement would contain the most information in the fewest words?" | ||
"I believe it is the atomic hypothesis (or atomic fact, or whatever you" | ||
"wish to call it) that all things are made of atoms — little particles" | ||
"that move around in perpetual motion, attracting each other when they" | ||
"are a little distance apart, but repelling upon being squeezed into" | ||
"one another. In that one sentence you will see an enormous amount of" | ||
"information about the world, if just a little imagination and thinking" | ||
"are applied.\n") "\n")) | ||
(str-equal-or-exit (mu:body-txt msg) (mu:body msg)) | ||
(let ((got (mu:body-html msg))) | ||
(if got | ||
(error-exit "Expected #f, got ~a" got))) | ||
|
||
(if (not (equal? (mu:priority msg) mu:prio:high)) | ||
(error-exit "Expected ~a, got ~a" (mu:priority msg) mu:prio:high)))) | ||
|