From: Austin Clements Date: Fri, 3 Oct 2014 14:19:11 +0000 (+2000) Subject: [PATCH 04/11] lib: Add a ghost messages database feature X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=916acf70033aee83915f28b1750185b0601fc796;p=notmuch-archives.git [PATCH 04/11] lib: Add a ghost messages database feature --- diff --git a/e0/a2ea3a767637e667877588aaf47731816a1305 b/e0/a2ea3a767637e667877588aaf47731816a1305 new file mode 100644 index 000000000..862ee5f57 --- /dev/null +++ b/e0/a2ea3a767637e667877588aaf47731816a1305 @@ -0,0 +1,120 @@ +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 1CBBF431FCF + for ; Fri, 3 Oct 2014 07:19:46 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -2.3 +X-Spam-Level: +X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_MED=-2.3] 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 YyqfNB0IRS5k for ; + Fri, 3 Oct 2014 07:19:40 -0700 (PDT) +Received: from dmz-mailsec-scanner-7.mit.edu (dmz-mailsec-scanner-7.mit.edu + [18.7.68.36]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 9084F431FD2 + for ; Fri, 3 Oct 2014 07:19:26 -0700 (PDT) +X-AuditID: 12074424-f79346d000004923-f5-542eb06dc4b4 +Received: from mailhub-auth-3.mit.edu ( [18.9.21.43]) + (using TLS with cipher AES256-SHA (256/256 bits)) + (Client did not present a certificate) + by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP + id E8.BF.18723.D60BE245; Fri, 3 Oct 2014 10:19:25 -0400 (EDT) +Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) + by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id s93EJOBg018552; + Fri, 3 Oct 2014 10:19:24 -0400 +Received: from drake.dyndns.org + (216-15-114-40.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com + [216.15.114.40]) (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s93EJLAT023312 + (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); + Fri, 3 Oct 2014 10:19:23 -0400 +Received: from amthrax by drake.dyndns.org with local (Exim 4.84) + (envelope-from ) + id 1Xa3hZ-0002Jn-46; Fri, 03 Oct 2014 10:19:21 -0400 +From: Austin Clements +To: notmuch@notmuchmail.org +Subject: [PATCH 04/11] lib: Add a ghost messages database feature +Date: Fri, 3 Oct 2014 10:19:11 -0400 +Message-Id: <1412345958-8278-5-git-send-email-aclements@csail.mit.edu> +X-Mailer: git-send-email 2.1.0 +In-Reply-To: <1412345958-8278-1-git-send-email-aclements@csail.mit.edu> +References: <1412345958-8278-1-git-send-email-aclements@csail.mit.edu> +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFtrEIsWRmVeSWpSXmKPExsUixCmqrZu7QS/E4MpnQ4vrN2cyOzB6PFt1 + izmAMYrLJiU1J7MstUjfLoErY0HPR7aCG1wVz89PYm1gXMDRxcjJISFgInF96UoWCFtM4sK9 + 9WxdjFwcQgKzmSQ+X1rEDOFsYJSYu3sflHObSeLG0lvsEM4SRomDi56wgfSzCehLrFg7iRXE + FhGQlth5dzaQzcHBLKAm8adLBSQsLOAose7SbLASFgFViTu3vzOClPAKuEnsWFwFcYWcxIbd + /xlBbE4Bd4kLd5+CTRcCKll1rJttAiP/AkaGVYyyKblVurmJmTnFqcm6xcmJeXmpRbrmermZ + JXqpKaWbGEFBw+6isoOx+ZDSIUYBDkYlHt4PN3RDhFgTy4orcw8xSnIwKYnyVi7WCxHiS8pP + qcxILM6ILyrNSS0+xCjBwawkwrtgJVCONyWxsiq1KB8mJc3BoiTOu+kHX4iQQHpiSWp2ampB + ahFMVoaDQ0mCt309UKNgUWp6akVaZk4JQpqJgxNkOA/QcLAa3uKCxNzizHSI/ClGRSlx3ofr + gBICIImM0jy4XlhUv2IUB3pFmLcLpJ0HmBDgul8BDWYCGvzOXhdkcEkiQkqqgbH3wkE1P16b + /Q9nTf9Rz/eQ9deeDye3flV2C/0974NdfOxv4dtva8O3Bv2bwq8psTiil/t06IyDoVvYJ0Ya + WAR2L3v34fjmxyYm7AdyZ38I9U4/oTWbX9Doq+bTt2+33jsu/b4n+uvs2OwwPbkGd4lXkef2 + dO3j3tn744+E9U4DRuvnT9s8oryVWIozEg21mIuKEwGocOkBxQIAAA== +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: Fri, 03 Oct 2014 14:19:46 -0000 + +From: Austin Clements + +This will be implemented over the next several patches. The feature +is not yet "enabled" (this does not add it to +NOTMUCH_FEATURES_CURRENT). +--- + lib/database-private.h | 7 +++++++ + lib/database.cc | 2 ++ + 2 files changed, 9 insertions(+) + +diff --git a/lib/database-private.h b/lib/database-private.h +index ca0751c..e2e4bc8 100644 +--- a/lib/database-private.h ++++ b/lib/database-private.h +@@ -85,6 +85,13 @@ enum _notmuch_features { + * + * Introduced: version 2. */ + NOTMUCH_FEATURE_BOOL_FOLDER = 1 << 3, ++ ++ /* If set, missing messages are stored in ghost mail documents. ++ * If unset, thread IDs of ghost messages are stored as database ++ * metadata instead of in ghost documents. ++ * ++ * Introduced: version 3. */ ++ NOTMUCH_FEATURE_GHOSTS = 1 << 4, + }; + + /* In C++, a named enum is its own type, so define bitwise operators +diff --git a/lib/database.cc b/lib/database.cc +index 1c6ffc5..8fd7fad 100644 +--- a/lib/database.cc ++++ b/lib/database.cc +@@ -286,6 +286,8 @@ static const struct { + "from/subject/message-ID in database", "w" }, + { NOTMUCH_FEATURE_BOOL_FOLDER, + "exact folder:/path: search", "rw" }, ++ { NOTMUCH_FEATURE_GHOSTS, ++ "mail documents for missing messages", "w"}, + }; + + const char * +-- +2.1.0 +