/* Get the message ID of 'message'. * * The returned string belongs to 'message' and as such, should not be * modified by the caller and will only be valid for as long as the * message is valid, (which is until the query from which it derived * is destroyed). * * This function will not return NULL since Notmuch ensures that every * message has a unique message ID, (Notmuch will generate an ID for a * message if the original file does not contain one). */ func (self *Message) GetMessageId() string { if self.message == nil { return "" } id := C.notmuch_message_get_message_id(self.message) // we dont own id // defer C.free(unsafe.Pointer(id)) if id == nil { return "" } return C.GoString(id) }
// ID returns the message ID. func (m *Message) ID() string { return C.GoString(C.notmuch_message_get_message_id(m.toC())) }