aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Austin Clements <amdragon@MIT.EDU>2012-08-07 08:57:10 -0400
committerGravatar David Bremner <bremner@debian.org>2012-08-12 21:29:38 +0200
commite0d97a639c3f8cafd84c0c81b9412cfd48b516c1 (patch)
tree0be873d5eb77eb7c5bab9e57e632e98d737629d4
parentd41946ea781caaf9652d037caa5f65a93a199b80 (diff)
reply: Convert JSON format to use sprinter
Almost all of reply was already being formatted using the sprinter. This patch converts the top-level dictionary to use the sprinter interface.
-rw-r--r--notmuch-reply.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/notmuch-reply.c b/notmuch-reply.c
index fa6665f7..e60a264b 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -614,20 +614,20 @@ notmuch_reply_format_json(void *ctx,
return 1;
sp = sprinter_json_create (ctx, stdout);
+ sp->begin_map (sp);
/* The headers of the reply message we've created */
- printf ("{\"reply-headers\": ");
+ sp->map_key (sp, "reply-headers");
format_headers_json (sp, reply, TRUE);
g_object_unref (G_OBJECT (reply));
reply = NULL;
/* Start the original */
- printf (", \"original\": ");
-
+ sp->map_key (sp, "original");
format_part_json (ctx, sp, node, TRUE, TRUE);
/* End */
- printf ("}\n");
+ sp->end (sp);
notmuch_message_destroy (message);
return 0;