unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Austin Clements <amdragon@MIT.EDU>
To: notmuch@notmuchmail.org
Subject: [PATCH 2/6] show: Remove support for old-style formatters in show_message
Date: Sat,  7 Apr 2012 20:57:46 -0400	[thread overview]
Message-ID: <1333846670-5356-3-git-send-email-amdragon@mit.edu> (raw)
In-Reply-To: <1333846670-5356-1-git-send-email-amdragon@mit.edu>

show_message used to have a compatibility path for old-style
formatters.  This removes that.
---
 notmuch-show.c |   52 +++++++++++++---------------------------------------
 1 files changed, 13 insertions(+), 39 deletions(-)

diff --git a/notmuch-show.c b/notmuch-show.c
index 0bf5e21..5a71115 100644
--- a/notmuch-show.c
+++ b/notmuch-show.c
@@ -815,46 +815,20 @@ show_message (void *ctx,
 	      int indent,
 	      notmuch_show_params_t *params)
 {
-    if (format->part) {
-	void *local = talloc_new (ctx);
-	mime_node_t *root, *part;
-	notmuch_status_t status;
-
-	status = mime_node_open (local, message, params->cryptoctx,
-				 params->decrypt, &root);
-	if (status)
-	    goto DONE;
-	part = mime_node_seek_dfs (root, (params->part < 0 ? 0 : params->part));
-	if (part)
-	    status = format->part (local, part, indent, params);
-      DONE:
-	talloc_free (local);
-	return status;
-    }
-
-    if (params->part <= 0) {
-	fputs (format->message_start, stdout);
-	if (format->message)
-	    format->message(ctx, message, indent);
-
-	fputs (format->header_start, stdout);
-	if (format->header)
-	    format->header(ctx, message);
-	fputs (format->header_end, stdout);
-
-	fputs (format->body_start, stdout);
-    }
-
-    if (format->part_content)
-	show_message_body (message, format, params);
-
-    if (params->part <= 0) {
-	fputs (format->body_end, stdout);
-
-	fputs (format->message_end, stdout);
-    }
+    void *local = talloc_new (ctx);
+    mime_node_t *root, *part;
+    notmuch_status_t status;
 
-    return NOTMUCH_STATUS_SUCCESS;
+    status = mime_node_open (local, message, params->cryptoctx,
+			     params->decrypt, &root);
+    if (status)
+	goto DONE;
+    part = mime_node_seek_dfs (root, (params->part < 0 ? 0 : params->part));
+    if (part)
+	status = format->part (local, part, indent, params);
+  DONE:
+    talloc_free (local);
+    return status;
 }
 
 static notmuch_status_t
-- 
1.7.9.1

  parent reply	other threads:[~2012-04-08  0:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-08  0:57 [PATCH 0/6] Finish show rewrite Austin Clements
2012-04-08  0:57 ` [PATCH 1/6] Sync schemata with current code structure Austin Clements
2012-04-08  0:57 ` Austin Clements [this message]
2012-04-08  0:57 ` [PATCH 3/6] Remove show-message.c Austin Clements
2012-04-08  0:57 ` [PATCH 4/6] show: Remove unused fields from notmuch_show_format Austin Clements
2012-04-08  0:57 ` [PATCH 5/6] show: Support NULL values for message_set_{start, sep, end} Austin Clements
2012-04-08  0:57 ` [PATCH 6/6] show: Remove empty message_set_{start,sep,end} fields Austin Clements
2012-04-11 19:11 ` [PATCH 0/6] Finish show rewrite Tomi Ollila
2012-04-13 12:33 ` Mark Walters
2012-04-14 19:43 ` Jameson Graef Rollins
2012-04-15 12:45 ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1333846670-5356-3-git-send-email-amdragon@mit.edu \
    --to=amdragon@mit.edu \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).