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 7FF59431FBC for ; Sat, 7 Mar 2015 12:23:59 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0.139 X-Spam-Level: X-Spam-Status: No, score=0.139 tagged_above=-999 required=5 tests=[DNS_FROM_AHBL_RHSBL=2.438, FREEMAIL_FROM=0.001, 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 bvUj2LBR7gyP for ; Sat, 7 Mar 2015 12:23:56 -0800 (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 53684431FAE for ; Sat, 7 Mar 2015 12:23:56 -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 <0NKU00GHPZBSNY00@nk11p00mm-asmtp004.mac.com> for notmuch@notmuchmail.org; Sat, 07 Mar 2015 20:23:53 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.13.68,1.0.33,0.0.0000 definitions=2015-03-07_02:2015-03-06, 2015-03-07, 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-1503070221 From: Trevor Jim To: notmuch@notmuchmail.org Subject: [PATCH v2] go: add binding for notmuch_message_get_date Date: Sat, 07 Mar 2015 15:23:51 -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: Sat, 07 Mar 2015 20:23:59 -0000 --- bindings/go/src/notmuch/notmuch.go | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/bindings/go/src/notmuch/notmuch.go b/bindings/go/src/notmuch/notmuch.go index b9230ad..5857b67 100644 --- a/bindings/go/src/notmuch/notmuch.go +++ b/bindings/go/src/notmuch/notmuch.go @@ -801,7 +801,22 @@ 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 +/* Get the timestamp (seconds since the epoch) of 'message'. + * + * Return status: + * + * NOTMUCH_STATUS_SUCCESS: Timestamp successfully retrieved + * + * NOTMUCH_STATUS_NULL_POINTER: The 'message' argument is NULL + * + */ +func (self *Message) GetDate() (int64, Status) { + if self.message == nil { + return -1, STATUS_NULL_POINTER + } + timestamp := C.notmuch_message_get_date(self.message) + return int64(timestamp), STATUS_SUCCESS +} /* Get the value of the specified header from 'message'. * -- 2.2.2