From: Peter Wang Date: Mon, 6 Aug 2012 14:36:59 +0000 (+1000) Subject: Re: [PATCH 1/4] show: indicate length of omitted body content (json) X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=4097c31c4f337f11fda436cf58dff23c047278d2;p=notmuch-archives.git Re: [PATCH 1/4] show: indicate length of omitted body content (json) --- diff --git a/43/078a3cd975a7674c1a3e388d0d7c5eda72cbe6 b/43/078a3cd975a7674c1a3e388d0d7c5eda72cbe6 new file mode 100644 index 000000000..a57ecbb14 --- /dev/null +++ b/43/078a3cd975a7674c1a3e388d0d7c5eda72cbe6 @@ -0,0 +1,102 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 45797431FAF + for ; Mon, 6 Aug 2012 07:37:07 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.799 +X-Spam-Level: +X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id ZOwomuIRqIVh for ; + Mon, 6 Aug 2012 07:37:06 -0700 (PDT) +Received: from mail-gh0-f181.google.com (mail-gh0-f181.google.com + [209.85.160.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id A85DF431FAE + for ; Mon, 6 Aug 2012 07:37:06 -0700 (PDT) +Received: by ghz3 with SMTP id 3so863543ghz.26 + for ; Mon, 06 Aug 2012 07:37:05 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=date:message-id:from:to:cc:subject:in-reply-to:references + :mime-version:content-type:content-disposition + :content-transfer-encoding; + bh=DAiVgAPM6rAgZdt7HNzY6+DMrjf9zMo/5UKQulnLJ/E=; + b=IO1mLgznH7WT/4SBwTTtzPKXu97EY35mH17Qbm9mjqfsDUxkTzrCV4q2CCpI8QdarK + 8ewzNmRvG60Ycqmg1iSYkFws/L9c379yEQ2luEqJo6IiS/v6ClEjDkJ0ehSeIlzkY/jm + NeiVMoC+V5JNnJqkeFGkUu6prn3QI2l+UjkyHrl7mkHccLyU5e3238t42ek3PRx5Sp7X + DSbK4bcHzJ1rLXMsv6/0AlxS6l4pooaIYg7jSsPVM5Xgqz/B7OyRBKYlchzwmPLVVPkL + kvn4NsLNYqdaiDMVjA2zHJgG901Qe9GboxjqFrCQSqwPYEeCMWQq+EE1Bsl9G1aaYR1l + BetA== +Received: by 10.68.203.98 with SMTP id kp2mr19386113pbc.132.1344263825501; + Mon, 06 Aug 2012 07:37:05 -0700 (PDT) +Received: from localhost (215.42.233.220.static.exetel.com.au. + [220.233.42.215]) + by mx.google.com with ESMTPS id wn1sm1741522pbc.57.2012.08.06.07.37.02 + (version=TLSv1/SSLv3 cipher=OTHER); + Mon, 06 Aug 2012 07:37:04 -0700 (PDT) +Date: Tue, 7 Aug 2012 00:36:59 +1000 +Message-ID: <20120807003659.GA22470@hili.localdomain> +From: Peter Wang +To: Jameson Graef Rollins +Subject: Re: [PATCH 1/4] show: indicate length of omitted body content (json) +In-Reply-To: <87y5ltuikh.fsf@servo.finestructure.net> +References: <1344151345-25411-1-git-send-email-novalazy@gmail.com> + <87y5ltuikh.fsf@servo.finestructure.net> +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf-8 +Content-Disposition: inline +Content-Transfer-Encoding: 8bit +Cc: notmuch@notmuchmail.org +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +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: Mon, 06 Aug 2012 14:37:07 -0000 + +On Sun, 05 Aug 2012 14:37:02 -0700, Jameson Graef Rollins wrote: +> On Sun, Aug 05 2012, Peter Wang wrote: +> > diff --git a/devel/schemata b/devel/schemata +> > index 9cb25f5..3df2764 100644 +> > --- a/devel/schemata +> > +++ b/devel/schemata +> > @@ -69,7 +69,10 @@ part = { +> > # A leaf part's body content is optional, but may be included if +> > # it can be correctly encoded as a string. Consumers should use +> > # this in preference to fetching the part content separately. +> > - content?: string +> > + content?: string, +> > + # If a leaf part's body content is not included, the content-length +> > + # may be included instead. +> > + content-length?: int +> +> Hey, Peter. Something somewhere, and probably at least here in the +> schemata, should mention what the uids are (b? kB? KiB? YiB?) + +I thought content-length was a MIME header, but it's not. +Anyway, it's the length of the encoded content in bytes. GMime +doesn't provide an easy way to return the length of the decoded content. + +I actually only need an _estimate_ of the decoded size to present to the +user. Strictly speaking, that requires knowledge of the transfer encoding. +Previously I planned on guessing it from the content-type, but I think +it's better to return the transfer encoding as well (if any). + +Alternatively, notmuch could put in more effort to return the exact +length of the decoded content. But it's a waste of time if no consumers +will use it. + +Peter