aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Austin Clements <amdragon@MIT.EDU>2012-04-28 17:45:18 -0400
committerGravatar David Bremner <bremner@debian.org>2012-05-04 08:49:43 -0300
commitce53850290e81ace34af5a1d418cc8941d0d3b8f (patch)
treebb28c631ff8debccc1d980b574321877ca038607
parentfcfb619b44b0011ac6bc557e6cbe2d516bc58f8a (diff)
go: Update to the current notmuch_database_find_message API
The signature of notmuch_database_find_message was changed in 02a30767 to report errors and the Go bindings were never updated. This brings the Go bindings in sync with that change and at least makes them compile with Go r60.3, the last release before Go 1.
-rw-r--r--bindings/go/pkg/notmuch.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/bindings/go/pkg/notmuch.go b/bindings/go/pkg/notmuch.go
index d32901d4..de9de23c 100644
--- a/bindings/go/pkg/notmuch.go
+++ b/bindings/go/pkg/notmuch.go
@@ -306,20 +306,21 @@ func (self *Database) RemoveMessage(fname string) Status {
* * An out-of-memory situation occurs
* * A Xapian exception occurs
*/
-func (self *Database) FindMessage(message_id string) *Message {
+func (self *Database) FindMessage(message_id string) (*Message, Status) {
var c_msg_id *C.char = C.CString(message_id)
defer C.free(unsafe.Pointer(c_msg_id))
if c_msg_id == nil {
- return nil
+ return nil, STATUS_OUT_OF_MEMORY
}
- msg := C.notmuch_database_find_message(self.db, c_msg_id)
- if msg == nil {
- return nil
+ msg := &Message{message:nil}
+ st := Status(C.notmuch_database_find_message(self.db, c_msg_id, &msg.message))
+ if st != STATUS_SUCCESS {
+ return nil, st
}
- return &Message{message:msg}
+ return msg, st
}
/* Return a list of all tags found in the database.