diff options
| author | Trevor Jim <tjim@mac.com> | 2015-03-07 15:23:51 -0500 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2015-03-08 08:25:44 +0100 |
| commit | 05b27ee0ddc3de286f2acce3bed1e6e5ed3c28e3 (patch) | |
| tree | 91d1e991e13e1a36e3cce2b346333eb5ecca965c | |
| parent | 90886f3640ed6aaace84ee7a83a8d2afa2d0c8fb (diff) | |
go: add binding for notmuch_message_get_date
| -rw-r--r-- | bindings/go/src/notmuch/notmuch.go | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/bindings/go/src/notmuch/notmuch.go b/bindings/go/src/notmuch/notmuch.go index b9230ad2..0fff1ab6 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'. * |
