1 Return-Path: <feh@noam.feh.name>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id CD636431FBF
\r
6 for <notmuch@notmuchmail.org>; Sat, 2 Mar 2013 06:57:32 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id oLa2mW3eP5JU for <notmuch@notmuchmail.org>;
\r
16 Sat, 2 Mar 2013 06:57:28 -0800 (PST)
\r
17 Received: from noam.feh.name (noam.feh.name [176.9.34.52])
\r
18 by olra.theworths.org (Postfix) with ESMTP id EF19B431FBC
\r
19 for <notmuch@notmuchmail.org>; Sat, 2 Mar 2013 06:57:27 -0800 (PST)
\r
20 Received: by noam.feh.name (Postfix, from userid 1000)
\r
21 id 51F60157C12F; Sat, 2 Mar 2013 15:51:19 +0100 (CET)
\r
22 From: Julius Plenz <julius@plenz.com>
\r
23 To: notmuch@notmuchmail.org
\r
24 Subject: [PATCH 3/3] Go bindings: Wrap (most) remaining notmuch thread
\r
26 Date: Sat, 2 Mar 2013 15:50:56 +0100
\r
27 Message-Id: <1362235856-15358-3-git-send-email-julius@plenz.com>
\r
28 X-Mailer: git-send-email 1.7.2.5
\r
29 In-Reply-To: <1362235856-15358-1-git-send-email-julius@plenz.com>
\r
30 References: <1362235856-15358-1-git-send-email-julius@plenz.com>
\r
31 X-Mailman-Approved-At: Sat, 02 Mar 2013 09:47:30 -0800
\r
32 Cc: Julius Plenz <julius@plenz.com>
\r
33 X-BeenThere: notmuch@notmuchmail.org
\r
34 X-Mailman-Version: 2.1.13
\r
36 List-Id: "Use and development of the notmuch mail system."
\r
37 <notmuch.notmuchmail.org>
\r
38 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
39 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
40 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
41 List-Post: <mailto:notmuch@notmuchmail.org>
\r
42 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
43 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
44 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
45 X-List-Received-Date: Sat, 02 Mar 2013 14:57:33 -0000
\r
48 bindings/go/src/notmuch/notmuch.go | 89 +++++++++++++++++++++++++++++++++++-
\r
49 1 file changed, 88 insertions(+), 1 deletion(-)
\r
51 diff --git a/bindings/go/src/notmuch/notmuch.go b/bindings/go/src/notmuch/notmuch.go
\r
52 index 306b104..8829f82 100644
\r
53 --- a/bindings/go/src/notmuch/notmuch.go
\r
54 +++ b/bindings/go/src/notmuch/notmuch.go
\r
55 @@ -385,7 +385,94 @@ func (self *Query) CountMessages() uint {
\r
56 return uint(C.notmuch_query_count_messages(self.query))
\r
59 -// TODO: wrap threads and thread
\r
60 +func (self *Thread) GetToplevelMessages() *Messages {
\r
61 + if self.thread == nil {
\r
64 + msgs := C.notmuch_thread_get_toplevel_messages(self.thread)
\r
68 + return &Messages{messages: msgs}
\r
71 +func (self *Thread) GetThreadId() string {
\r
72 + if self.thread == nil {
\r
75 + id := C.notmuch_thread_get_thread_id(self.thread)
\r
79 + return C.GoString(id)
\r
82 +func (self *Thread) GetTotalMessages() uint {
\r
83 + if self.thread == nil {
\r
86 + return uint(C.notmuch_thread_get_total_messages(self.thread))
\r
89 +func (self *Thread) GetMatchedMessages() uint {
\r
90 + if self.thread == nil {
\r
93 + return uint(C.notmuch_thread_get_matched_messages(self.thread))
\r
96 +func (self *Thread) GetAuthors() string {
\r
97 + if self.thread == nil {
\r
100 + authors := C.notmuch_thread_get_authors(self.thread)
\r
101 + if authors == nil {
\r
104 + return C.GoString(authors)
\r
107 +func (self *Thread) GetSubject() string {
\r
108 + if self.thread == nil {
\r
111 + subject := C.notmuch_thread_get_subject(self.thread)
\r
112 + if subject == nil {
\r
115 + return C.GoString(subject)
\r
118 +func (self *Threads) MoveToNext() {
\r
119 + if self.threads == nil {
\r
122 + C.notmuch_threads_move_to_next(self.threads)
\r
125 +func (self *Threads) Get() *Thread {
\r
126 + if self.threads == nil {
\r
129 + t := C.notmuch_threads_get(self.threads)
\r
133 + return &Thread{thread: t}
\r
136 +// TODO: notmuch_thread_get_oldest_date and notmuch_thread_get_newest_date
\r
138 +func (self *Thread) GetTags() *Tags {
\r
139 + if self.thread == nil {
\r
142 + tags := C.notmuch_thread_get_tags(self.thread)
\r
146 + return &Tags{tags: tags}
\r
149 func (self *Threads) Valid() bool {
\r
150 if self.threads == nil {
\r