From a848895786758af95870c16edb4d9a6cdff9904e Mon Sep 17 00:00:00 2001 From: Julius Plenz Date: Sat, 2 Mar 2013 15:50:55 +0100 Subject: [PATCH] [PATCH 2/3] Go bindings: wrap notmuch_message_get_date --- cd/3660c2ca0c5ea85fc56ca1065db400f14cb7f8 | 78 +++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 cd/3660c2ca0c5ea85fc56ca1065db400f14cb7f8 diff --git a/cd/3660c2ca0c5ea85fc56ca1065db400f14cb7f8 b/cd/3660c2ca0c5ea85fc56ca1065db400f14cb7f8 new file mode 100644 index 000000000..941c07da3 --- /dev/null +++ b/cd/3660c2ca0c5ea85fc56ca1065db400f14cb7f8 @@ -0,0 +1,78 @@ +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 D9C9D431FC0 + for ; Sat, 2 Mar 2013 06:57:32 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + 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 pB1vhf9e3ahN for ; + Sat, 2 Mar 2013 06:57:28 -0800 (PST) +Received: from noam.feh.name (noam.feh.name [176.9.34.52]) + by olra.theworths.org (Postfix) with ESMTP id F187C431FBD + for ; Sat, 2 Mar 2013 06:57:27 -0800 (PST) +Received: by noam.feh.name (Postfix, from userid 1000) + id 5EC23157C12E; Sat, 2 Mar 2013 15:51:18 +0100 (CET) +From: Julius Plenz +To: notmuch@notmuchmail.org +Subject: [PATCH 2/3] Go bindings: wrap notmuch_message_get_date +Date: Sat, 2 Mar 2013 15:50:55 +0100 +Message-Id: <1362235856-15358-2-git-send-email-julius@plenz.com> +X-Mailer: git-send-email 1.7.2.5 +In-Reply-To: <1362235856-15358-1-git-send-email-julius@plenz.com> +References: <1362235856-15358-1-git-send-email-julius@plenz.com> +X-Mailman-Approved-At: Sat, 02 Mar 2013 09:47:30 -0800 +Cc: Julius Plenz +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: Sat, 02 Mar 2013 14:57:33 -0000 + +--- + bindings/go/src/notmuch/notmuch.go | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/bindings/go/src/notmuch/notmuch.go b/bindings/go/src/notmuch/notmuch.go +index 0bdbba9..306b104 100644 +--- a/bindings/go/src/notmuch/notmuch.go ++++ b/bindings/go/src/notmuch/notmuch.go +@@ -12,6 +12,7 @@ package notmuch + */ + import "C" + import "unsafe" ++import "time" + + // Status codes used for the return values of most functions + type Status C.notmuch_status_t +@@ -559,7 +560,12 @@ func (self *Message) SetFlag(flag Flag, value bool) { + C.notmuch_message_set_flag(self.message, C.notmuch_message_flag_t(flag), v) + } + +-// TODO: wrap notmuch_message_get_date ++func (self *Message) GetDate() time.Time { ++ if self.message == nil { ++ return time.Unix(0, 0) ++ } ++ return time.Unix(int64(C.notmuch_message_get_date(self.message)), 0) ++} + + // Get the value of the specified header from the message. The value + // will be read from the actual message file, not from the notmuch +-- +1.7.10.4 + -- 2.26.2