* [PATCH v2] go: add binding for notmuch_message_get_date
@ 2015-03-07 20:23 Trevor Jim
2015-03-08 7:27 ` David Bremner
0 siblings, 1 reply; 2+ messages in thread
From: Trevor Jim @ 2015-03-07 20:23 UTC (permalink / raw)
To: notmuch
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] go: add binding for notmuch_message_get_date
2015-03-07 20:23 [PATCH v2] go: add binding for notmuch_message_get_date Trevor Jim
@ 2015-03-08 7:27 ` David Bremner
0 siblings, 0 replies; 2+ messages in thread
From: David Bremner @ 2015-03-08 7:27 UTC (permalink / raw)
To: Trevor Jim, notmuch
Trevor Jim <tjim@mac.com> writes:
> ---
> bindings/go/src/notmuch/notmuch.go | 17 ++++++++++++++++-
> 1 file changed, 16 insertions(+), 1 deletion(-)
>
pushed, with one whitespace fix (the standard pre-commit hook is handy
for avoiding that).
d
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-03-08 7:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-07 20:23 [PATCH v2] go: add binding for notmuch_message_get_date Trevor Jim
2015-03-08 7:27 ` David Bremner
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).