]> git.notmuchmail.org Git - notmuch/commit
show: Rewrite show_message_body to use the MIME tree interface.
authorAustin Clements <amdragon@MIT.EDU>
Sat, 24 Dec 2011 18:52:46 +0000 (13:52 -0500)
committerDavid Bremner <bremner@debian.org>
Mon, 26 Dec 2011 02:23:15 +0000 (22:23 -0400)
commitd61cef374b3234c2f1327fa74b612b40c196a605
tree902e3c29c1e67d2ceee54d545c1c95ac8f541fc0
parent5d1ac7d1d351c6f122ddaa44d3c82ec68d45178c
show: Rewrite show_message_body to use the MIME tree interface.

This removes all of the MIME traversal logic from show_message_body
and leaves only its interaction with the format callbacks.

Besides isolating concerns, since traversal happens behind a trivial
interface, there is now much less code duplication in
show_message_part.  Also, this uses mime_node_seek_dfs to start at the
requested part, eliminating all of the logic about parts being
selected or being in_zone (and reducing the "show state" to only a
part counter).  notmuch_show_params_t no longer needs to be passed
through the recursion because the only two fields that mattered
(related to crypto) are now handled by the MIME tree.

The few remaining complexities in show_message_part highlight
irregularities in the format callbacks with respect to top-level
messages and embedded message parts.

Since this is a rewrite, the diff is not very enlightening.  It's
easier to look at the old code and the new code side-by-side.
show-message.c