about summary refs log tree commit diff stats
path: root/worker/notmuch/lib/database.go
diff options
context:
space:
mode:
authorReto Brunner <reto@labrat.space>2019-12-21 16:21:26 +0100
committerDrew DeVault <sir@cmpwn.com>2019-12-21 11:20:11 -0500
commit40ceee969bd29508c1da28052c95eb85a52650ba (patch)
tree0224774c182196a7352496c7f461136285de0471 /worker/notmuch/lib/database.go
parent2705d8460d7e974ee01ad41ce063ae3feeb30317 (diff)
downloadaerc-40ceee969bd29508c1da28052c95eb85a52650ba.tar.gz
notmuch: emit LabelList event
Diffstat (limited to 'worker/notmuch/lib/database.go')
-rw-r--r--worker/notmuch/lib/database.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/worker/notmuch/lib/database.go b/worker/notmuch/lib/database.go
index f4fd588..0706bbc 100644
--- a/worker/notmuch/lib/database.go
+++ b/worker/notmuch/lib/database.go
@@ -55,6 +55,23 @@ func (db *DB) connectRO() error {
 	return nil
 }
 
+// ListTags lists all known tags
+func (db *DB) ListTags() ([]string, error) {
+	if db.ro == nil {
+		return nil, fmt.Errorf("not connected to the notmuch db")
+	}
+	tags, err := db.ro.Tags()
+	if err != nil {
+		return nil, err
+	}
+	var result []string
+	var tag *notmuch.Tag
+	for tags.Next(&tag) {
+		result = append(result, tag.Value)
+	}
+	return result, nil
+}
+
 //getQuery returns a query based on the provided query string.
 //It also configures the query as specified on the worker
 func (db *DB) newQuery(query string) (*notmuch.Query, error) {
remented version number and updated pydoc html files' href='/akspecs/ranger/commit/doc/pydoc/ranger.html?h=v1.1.2&id=34a60763e79546e0f84e30fbcc430632f3dbb39e'>34a60763 ^
f07bb12f ^
4c13e1f2 ^
34a60763 ^
b3556b21 ^
f07bb12f ^

62cd83ba ^










f07bb12f ^




62cd83ba ^

34a60763 ^

62cd83ba ^





34a60763 ^
62cd83ba ^
f07bb12f ^





62cd83ba ^
f07bb12f ^





62cd83ba ^
f07bb12f ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75