From: Trevor Jim Date: Mon, 2 Mar 2015 20:39:17 +0000 (+1900) Subject: [PATCH] go: add binding for notmuch_message_get_date X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=03490c6239ed176f8b144c9f243e12f05f8dd525;p=notmuch-archives.git [PATCH] go: add binding for notmuch_message_get_date --- diff --git a/ec/78c5b029231b5592552231209cf12e677f0770 b/ec/78c5b029231b5592552231209cf12e677f0770 new file mode 100644 index 000000000..5d27dc721 --- /dev/null +++ b/ec/78c5b029231b5592552231209cf12e677f0770 @@ -0,0 +1,88 @@ +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 5864A431FAF + for ; Mon, 2 Mar 2015 13:41:56 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 1.739 +X-Spam-Level: * +X-Spam-Status: No, score=1.739 tagged_above=-999 required=5 + tests=[DNS_FROM_AHBL_RHSBL=2.438, 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 Pz5Tc2SKeDrC for ; + Mon, 2 Mar 2015 13:41:53 -0800 (PST) +X-Greylist: delayed 3598 seconds by postgrey-1.32 at olra; + Mon, 02 Mar 2015 13:41:53 PST +Received: from nk11p00mm-asmtp004.mac.com (nk11p00mm-asmtp004.mac.com + [17.158.161.3]) + (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 2B24E431FAE + for ; Mon, 2 Mar 2015 13:41:53 -0800 (PST) +Received: from localhost (aegis.CS.Princeton.EDU [128.112.139.195]) + by nk11p00mm-asmtp004.mac.com + (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Dec 4 + 2014)) + with ESMTPSA id <0NKL0059JQPH7V30@nk11p00mm-asmtp004.mac.com> for + notmuch@notmuchmail.org; Mon, 02 Mar 2015 20:39:19 +0000 (GMT) +X-Proofpoint-Virus-Version: vendor=fsecure + engine=2.50.10432:5.13.68,1.0.33,0.0.0000 + definitions=2015-03-02_03:2015-03-02, 2015-03-02, + 1970-01-01 signatures=0 +X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 + suspectscore=3 phishscore=0 adultscore=0 bulkscore=0 classifier=spam + adjust=0 + reason=mlx scancount=1 engine=7.0.1-1412110000 + definitions=main-1503020212 +From: Trevor Jim +To: notmuch@notmuchmail.org +Subject: [PATCH] go: add binding for notmuch_message_get_date +Date: Mon, 02 Mar 2015 15:39:17 -0500 +Message-id: +MIME-version: 1.0 +Content-type: text/plain +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, 02 Mar 2015 21:41:56 -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 b9230ad..f5fd54c 100644 +--- a/bindings/go/src/notmuch/notmuch.go ++++ b/bindings/go/src/notmuch/notmuch.go +@@ -801,7 +801,13 @@ 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() int64 { ++ if self.message == nil { ++ return -1 ++ } ++ timestamp := C.notmuch_message_get_date(self.message) ++ return int64(timestamp) ++} + + /* Get the value of the specified header from 'message'. + * +-- +2.2.2 +