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

There are no more calls to show_message_body.
---
 Makefile.local   |    1 -
 notmuch-client.h |    5 ---
 show-message.c   |  106 ------------------------------------------------------
 3 files changed, 0 insertions(+), 112 deletions(-)
 delete mode 100644 show-message.c

diff --git a/Makefile.local b/Makefile.local
index 1131dea..935f0f1 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -301,7 +301,6 @@ notmuch_client_srcs =		\
 	notmuch-tag.c		\
 	notmuch-time.c		\
 	query-string.c		\
-	show-message.c		\
 	mime-node.c		\
 	json.c
 
diff --git a/notmuch-client.h b/notmuch-client.h
index 203ac49..34155fc 100644
--- a/notmuch-client.h
+++ b/notmuch-client.h
@@ -184,11 +184,6 @@ char *
 query_string_from_args (void *ctx, int argc, char *argv[]);
 
 notmuch_status_t
-show_message_body (notmuch_message_t *message,
-		   const notmuch_show_format_t *format,
-		   notmuch_show_params_t *params);
-
-notmuch_status_t
 show_one_part (const char *filename, int part);
 
 void
diff --git a/show-message.c b/show-message.c
deleted file mode 100644
index 83ecf81..0000000
--- a/show-message.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/* notmuch - Not much of an email program, (just index and search)
- *
- * Copyright © 2009 Carl Worth
- * Copyright © 2009 Keith Packard
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see http://www.gnu.org/licenses/ .
- *
- * Authors: Carl Worth <cworth@cworth.org>
- *	    Keith Packard <keithp@keithp.com>
- */
-
-#include "notmuch-client.h"
-
-typedef struct show_message_state {
-    int part_count;
-} show_message_state_t;
-
-static void
-show_message_part (mime_node_t *node,
-		   show_message_state_t *state,
-		   const notmuch_show_format_t *format,
-		   int first)
-{
-    /* Formatters expect the envelope for embedded message parts */
-    GMimeObject *part = node->envelope_part ?
-	GMIME_OBJECT (node->envelope_part) : node->part;
-    int i;
-
-    if (!first)
-	fputs (format->part_sep, stdout);
-
-    /* Format this part */
-    if (format->part_start)
-	format->part_start (part, &(state->part_count));
-
-    if (node->decrypt_attempted && format->part_encstatus)
-	format->part_encstatus (node->decrypt_success);
-
-    if (node->verify_attempted && format->part_sigstatus)
-#ifdef GMIME_ATLEAST_26
-	format->part_sigstatus (node->sig_list);
-#else
-	format->part_sigstatus (node->sig_validity);
-#endif
-
-    format->part_content (part);
-
-    if (node->envelope_part) {
-	fputs (format->header_start, stdout);
-	if (format->header_message_part)
-	    format->header_message_part (GMIME_MESSAGE (node->part));
-	fputs (format->header_end, stdout);
-
-	fputs (format->body_start, stdout);
-    }
-
-    /* Recurse over the children */
-    state->part_count += 1;
-    for (i = 0; i < node->nchildren; i++)
-	show_message_part (mime_node_child (node, i), state, format, i == 0);
-
-    /* Finish this part */
-    if (node->envelope_part)
-	fputs (format->body_end, stdout);
-
-    if (format->part_end)
-	format->part_end (part);
-}
-
-notmuch_status_t
-show_message_body (notmuch_message_t *message,
-		   const notmuch_show_format_t *format,
-		   notmuch_show_params_t *params)
-{
-    notmuch_status_t ret;
-    show_message_state_t state;
-    mime_node_t *root, *part;
-
-    ret = mime_node_open (NULL, message, params->cryptoctx, params->decrypt,
-			  &root);
-    if (ret)
-	return ret;
-
-    /* The caller of show_message_body has already handled the
-     * outermost envelope, so skip it. */
-    state.part_count = MAX (params->part, 1);
-
-    part = mime_node_seek_dfs (root, state.part_count);
-    if (part)
-	show_message_part (part, &state, format, TRUE);
-
-    talloc_free (root);
-
-    return NOTMUCH_STATUS_SUCCESS;
-}
-- 
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 ` [PATCH 2/6] show: Remove support for old-style formatters in show_message Austin Clements
2012-04-08  0:57 ` Austin Clements [this message]
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-4-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).