From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 724136DE00AC for ; Sat, 28 Jan 2017 04:21:37 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.103 X-Spam-Level: X-Spam-Status: No, score=0.103 tagged_above=-999 required=5 tests=[AWL=0.123, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qw6Cl5V2rdMT for ; Sat, 28 Jan 2017 04:21:36 -0800 (PST) Received: from mail-lf0-f66.google.com (mail-lf0-f66.google.com [209.85.215.66]) by arlo.cworth.org (Postfix) with ESMTPS id C433D6DE00E8 for ; Sat, 28 Jan 2017 04:21:35 -0800 (PST) Received: by mail-lf0-f66.google.com with SMTP id x1so27943180lff.0 for ; Sat, 28 Jan 2017 04:21:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nikula-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ihizMNpPGbqCnA5rA1+GMV2fNXbb4GmiFNnVgnLEH1k=; b=ZqMsQk5eZrzIDfZg4SAz7lBb1nRSv9QLii8Eli0VyUEioTfwFuiJA3MpHlZzynKr/O zxV2l/w0rJlqeFoL0RVrSqFB9Ls5UQQPKnn1aA/IC8V1Jpopo1XBLeG9UIuSSVdZnLCi Dm2ICoVZHTGDVPDSdiYpc22V83RWWt3MGj4LkGaLwgVVVQRZWpuDKoo+QbwKmvi+HEL9 VStut2TMT6kmMi+1JQS3F3z0vHh8N4r/2eKpQ5+LKwTT/rjxnmTkQfdUehaSDECKHemP 8oeSgBBDImSTXMDwo47DTZ5CHyZGtNh34rWBknvMMQypLlHyivlv3kYsoJeqCbjHqU8D S5mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ihizMNpPGbqCnA5rA1+GMV2fNXbb4GmiFNnVgnLEH1k=; b=QcPBqSScKf7w9jE2nbgP28+lybVErP/HJb8Pb1FseHGMBTlYVP9lL/X8d6CtxgNk2v rqJk7Os4fUeeSC2V5I6Hax+fgd3e/tsFmdKQTPDoqUxFMD2MPi4tptDDXhnwIGwRX017 /brnrIE19/KacyqVAo4oijSmqKQ2PZVYtxdDT2NOZ142ZgZonXcYfcX/w+uuh5NYZyDb Rm/v8ZcDbMWpzM2yM3rYOMMmXjwum0o6CFzt5eo+k8HLu4uGeIlBktUwuITS1JN6Y59V X6JUYeCv43MglpV6Uv7pPmNsPSPIDJ68is/xX64k+qCMUV52oNHUxulNMcon/tp9HoWZ sAhQ== X-Gm-Message-State: AIkVDXJKtC7AEQ2tKJPQjDzInWvvhNbzWws/nH59lBuRQuPJ5b513/lPI0iwEdJv5qaPBQ== X-Received: by 10.25.150.200 with SMTP id y191mr2368511lfd.124.1485606093880; Sat, 28 Jan 2017 04:21:33 -0800 (PST) Received: from localhost (mobile-access-5d6a3e-39.dhcp.inet.fi. [93.106.62.39]) by smtp.gmail.com with ESMTPSA id r27sm2037803ljd.14.2017.01.28.04.21.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 28 Jan 2017 04:21:33 -0800 (PST) From: Jani Nikula To: notmuch@notmuchmail.org Subject: [PATCH 2/2] cli/show: add content-disposition to structured output message parts Date: Sat, 28 Jan 2017 14:21:30 +0200 Message-Id: <20170128122130.2935-2-jani@nikula.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170128122130.2935-1-jani@nikula.org> References: <20170128122130.2935-1-jani@nikula.org> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2017 12:21:37 -0000 Help the clients decide how to display parts. --- I'm not sure if this should bump the version in schemata, because the comment in notmuch-client.h says new map fields can be added without increasing NOTMUCH_FORMAT_CUR. Yet the schemata version history says thread_summary.query was added in v2... which looks like a change that shouldn't need a version bump. Confused. The problem could be avoided by conflating both this change and id:20170110201929.21875-1-jani@nikula.org into v3... ;) --- devel/schemata | 1 + notmuch-show.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/devel/schemata b/devel/schemata index 41dc4a60fff3..c94459eb783a 100644 --- a/devel/schemata +++ b/devel/schemata @@ -76,6 +76,7 @@ part = { sigstatus?: sigstatus, content-type: string, + content-disposition?: string, content-id?: string, # if content-type starts with "multipart/": content: [part*], diff --git a/notmuch-show.c b/notmuch-show.c index 8b38fe6db136..8e69b3465886 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -582,6 +582,7 @@ format_part_sprinter (const void *ctx, sprinter_t *sp, mime_node_t *node, GMimeObject *meta = node->envelope_part ? GMIME_OBJECT (node->envelope_part) : node->part; GMimeContentType *content_type = g_mime_object_get_content_type (meta); + const char *disposition = _get_disposition (meta); const char *cid = g_mime_object_get_content_id (meta); const char *filename = GMIME_IS_PART (node->part) ? g_mime_part_get_filename (GMIME_PART (node->part)) : NULL; @@ -611,6 +612,11 @@ format_part_sprinter (const void *ctx, sprinter_t *sp, mime_node_t *node, sp->map_key (sp, "content-type"); sp->string (sp, g_mime_content_type_to_string (content_type)); + if (disposition) { + sp->map_key (sp, "content-disposition"); + sp->string (sp, disposition); + } + if (cid) { sp->map_key (sp, "content-id"); sp->string (sp, cid); -- 2.11.0