mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-22 09:24:54 +01:00
go: update notmuch-addrlookup to the new API
notmuch.OpenDatabase now returns a status indicating success or failure. Use this information to inform the user of any failures. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
This commit is contained in:
parent
ece52759a5
commit
9f5478637c
1 changed files with 6 additions and 2 deletions
|
@ -209,8 +209,12 @@ func (self *address_matcher) run(name string) {
|
|||
queries := [3]*notmuch.Query{}
|
||||
|
||||
// open the database
|
||||
self.db = notmuch.OpenDatabase(self.user_db_path,
|
||||
notmuch.DATABASE_MODE_READ_ONLY)
|
||||
if db, status := notmuch.OpenDatabase(self.user_db_path,
|
||||
notmuch.DATABASE_MODE_READ_ONLY); status == notmuch.STATUS_SUCCESS {
|
||||
self.db = db
|
||||
} else {
|
||||
log.Fatalf("Failed to open the database: %v\n", status)
|
||||
}
|
||||
|
||||
// pass 1: look at all from: addresses with the address book tag
|
||||
query := "tag:" + self.user_addrbook_tag
|
||||
|
|
Loading…
Reference in a new issue