unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: James Vasile <james@hackervisions.org>
To: notmuch mailing list <notmuch@notmuchmail.org>
Subject: [PATCH] fix notmuch_database_open call in addrlookup
Date: Wed, 31 Oct 2012 12:43:24 -0400	[thread overview]
Message-ID: <87ip9q4moj.fsf@hackervisions.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1795 bytes --]

What's the best way to submit changes to addrlookup?  Right now, it is
out of date vs the latest libnotmuch.  The addrlookup repo is vala code
but the wiki [1] points to a generated c file [2].

[1] http://github.com/spaetz/vala-notmuch/raw/static-sources/src/addrlookup.c
[2] http://notmuchmail.org/emacstips/

At any rate, a patch to that c file is below.  If you upgraded notmuch
and now addrlookup gives errors about not finding libnotmuch.so.2, this
patch might be what you need.





In the latest version of notmuch in git, notmuch_database_open returns a
status and takes what used to be the return value as a reference
parameter.  This patch adjusts code to pass the db pointer in a
parameter and accept the status as return value.  We don't do anything
with the status at present.

---
 addrlookup.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/addrlookup.c b/addrlookup.c
index 5f724ef..aed77e7 100644
--- a/addrlookup.c
+++ b/addrlookup.c
@@ -804,12 +804,14 @@ void address_matcher_run (AddressMatcher* self, const gchar* name) {
        gchar** _result_;
        gint _result__length1;
        gint __result__size_;
+       notmuch_status_t status;
+
        g_return_if_fail (self != NULL);
        _tmp0_ = g_new0 (notmuch_query_t*, 0);
        queries = _tmp0_;
        queries_length1 = 0;
        _queries_size_ = 0;
-       _tmp1_ = notmuch_database_open (self->priv->user_db_path, NOTMUCH_DATABASE_MODE_READ_ONLY);
+       status = notmuch_database_open (self->priv->user_db_path, NOTMUCH_DATABASE_MODE_READ_ONLY, &_tmp1_);
        _notmuch_database_close0 (self->priv->db);
        self->priv->db = _tmp1_;
        _tmp2_ = g_strconcat ("tag:", self->priv->user_addrbook_tag, NULL);
-- 
1.7.10.4


[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

             reply	other threads:[~2012-10-31 16:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-31 16:43 James Vasile [this message]
2012-11-06  4:01 ` [PATCH] fix notmuch_database_open call in addrlookup Ethan Glasser-Camp
2012-11-07 14:20   ` James Vasile
2012-11-08  1:45     ` James Vasile

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ip9q4moj.fsf@hackervisions.org \
    --to=james@hackervisions.org \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).