mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 10:58:10 +01:00
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.
This commit is contained in:
parent
fcfb619b44
commit
ce53850290
1 changed files with 7 additions and 6 deletions
|
@ -306,20 +306,21 @@ func (self *Database) RemoveMessage(fname string) Status {
|
||||||
* * An out-of-memory situation occurs
|
* * An out-of-memory situation occurs
|
||||||
* * A Xapian exception 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)
|
var c_msg_id *C.char = C.CString(message_id)
|
||||||
defer C.free(unsafe.Pointer(c_msg_id))
|
defer C.free(unsafe.Pointer(c_msg_id))
|
||||||
|
|
||||||
if c_msg_id == nil {
|
if c_msg_id == nil {
|
||||||
return nil
|
return nil, STATUS_OUT_OF_MEMORY
|
||||||
}
|
}
|
||||||
|
|
||||||
msg := C.notmuch_database_find_message(self.db, c_msg_id)
|
msg := &Message{message:nil}
|
||||||
if msg == nil {
|
st := Status(C.notmuch_database_find_message(self.db, c_msg_id, &msg.message))
|
||||||
return nil
|
if st != STATUS_SUCCESS {
|
||||||
|
return nil, st
|
||||||
}
|
}
|
||||||
return &Message{message:msg}
|
return msg, st
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return a list of all tags found in the database.
|
/* Return a list of all tags found in the database.
|
||||||
|
|
Loading…
Reference in a new issue