From: Julius Plenz <julius@plenz.com>
To: notmuch@notmuchmail.org
Cc: Julius Plenz <julius@plenz.com>
Subject: [PATCH 2/3] Go bindings: wrap notmuch_message_get_date
Date: Sat, 2 Mar 2013 15:50:55 +0100 [thread overview]
Message-ID: <1362235856-15358-2-git-send-email-julius@plenz.com> (raw)
In-Reply-To: <1362235856-15358-1-git-send-email-julius@plenz.com>
---
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
next prev parent reply other threads:[~2013-03-02 14:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-02 14:50 [PATCH 1/3] Go bindings: clean up the documentation Julius Plenz
2013-03-02 14:50 ` Julius Plenz [this message]
2013-03-02 18:29 ` [PATCH 2/3] Go bindings: wrap notmuch_message_get_date Justus Winter
2013-03-02 14:50 ` [PATCH 3/3] Go bindings: Wrap (most) remaining notmuch thread functions Julius Plenz
2013-03-02 18:26 ` [PATCH 1/3] Go bindings: clean up the documentation Justus Winter
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=1362235856-15358-2-git-send-email-julius@plenz.com \
--to=julius@plenz.com \
--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).