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 3FBB96DE035A for ; Sun, 29 Jan 2017 03:56:44 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.071 X-Spam-Level: X-Spam-Status: No, score=0.071 tagged_above=-999 required=5 tests=[AWL=-0.059, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] 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 EMflkJyqm3by for ; Sun, 29 Jan 2017 03:56:42 -0800 (PST) Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by arlo.cworth.org (Postfix) with ESMTPS id 6CB906DE0319 for ; Sun, 29 Jan 2017 03:56:42 -0800 (PST) Received: by mail-wm0-f66.google.com with SMTP id r126so70340815wmr.3 for ; Sun, 29 Jan 2017 03:56:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=4SqZTmxe/bSDzSwnX9DKGNVKbRlU62tawF5rj9/2qwY=; b=eGJ9GnaCE5lwH+rfzyWeiEXZ1WVQtksXMnFnDk8wz23+NQ/9Qnn87ykVsu5TCFD8cl h8dt+lB0AqvfDsWDo8MxFl9/BIaPUJOo79BLxD2uSS66mw/Ce2TlHQGVeGZLtvv6kUhh L+7G79HJc2oJ/Z71eRMyLIV0wS3LtptukXR4hXtczY/ZBXe6h4vxBhg9Ynf3asfX7Fbi 81e3gqj+JGKOvgXV4d5fJKwOKa04lEnU3yOJZXXPAmaHxL6nUGMDlRIjT2fBnInRPkfP sOyPggb94CYEzsThVNeqVjtw8fNrA0wzO4ABeDtdR/GTwSBQR9eEhwxiAuwNYljZl2Xw ny8w== 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:in-reply-to:references:date :message-id:mime-version; bh=4SqZTmxe/bSDzSwnX9DKGNVKbRlU62tawF5rj9/2qwY=; b=mJoOtGteOHNkyCli0ouD1t6WZhX/e+uS187WP2DDU/TcCp6ZFdAPWbqmC2vogOGtJp maUGcsCkj5TDCWD//nws0CTZJ7v9oEoUnda7V2LGXsx4AAnnaPUSaed8eXZkwxIW1mvg 9ZFFfTaRDR9cLl7fmCaeghtbFuzJIQeZka7jFrnLPeuBZGGKn93N/AdPAIx6lD7mFGnz TfY+B8wkms2OarirogssLNsVGQkb/BiABV3hIAk+Ha8oQfPjLYzID7JXzI7DrND89QlU 5BIVcaP6taYcrZ/MpOuSVdwTEhFv/H8dXuJDwbP/8QuxQV12o1YJ/eaWpY55fJqU0aVo jY7Q== X-Gm-Message-State: AIkVDXLORPTPWhfNkepKbfaz4ITVPH46zgG1wFxrxQvz90W6Dp9XtcDLCC9EX7bJ8/s+3g== X-Received: by 10.28.141.199 with SMTP id p190mr10529306wmd.89.1485691000582; Sun, 29 Jan 2017 03:56:40 -0800 (PST) Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162]) by smtp.gmail.com with ESMTPSA id a72sm17423236wrc.48.2017.01.29.03.56.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 29 Jan 2017 03:56:39 -0800 (PST) From: Mark Walters To: Jani Nikula , notmuch@notmuchmail.org Subject: Re: [PATCH 2/2] cli/show: add content-disposition to structured output message parts In-Reply-To: <20170128122130.2935-2-jani@nikula.org> References: <20170128122130.2935-1-jani@nikula.org> <20170128122130.2935-2-jani@nikula.org> Date: Sun, 29 Jan 2017 11:56:39 +0000 Message-ID: <87lgtuxeo8.fsf@qmul.ac.uk> MIME-Version: 1.0 Content-Type: text/plain 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: Sun, 29 Jan 2017 11:56:44 -0000 On Sat, 28 Jan 2017, Jani Nikula wrote: > Help the clients decide how to display parts. This series looks good to me. I would say +1, but I am not sure my knowledge of C is really up to that. There are a bunch of tests to update; I will send a patch to do that in shortly. > 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. I think the reason for the bump before was that the client needed to know it had got the new format, so it could either bail out, or at least work around it, if it got the old format. In this case though, I think any sane program has to treat content-disposition nil as being "do whatever the default is" (since I don't think all parts have a content-disposition). Thus, I don't think we need a schemata bump, as the client can just use the extra information if present, and otherwise do what it normally would. Best wishes Mark > > 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