summary refs log tree commit diff stats
path: root/config
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-03-15 21:33:08 -0400
committerDrew DeVault <sir@cmpwn.com>2019-03-15 21:33:08 -0400
commit77c76ba46296f57f88c591a420e929a059a55d3e (patch)
tree98b74a88d1260c57674908be14956117939176f6 /config
parentb181e0449d552a03db49da8e3edace9b3d7cfaa6 (diff)
downloadaerc-77c76ba46296f57f88c591a420e929a059a55d3e.tar.gz
Implement default in accounts.conf
Diffstat (limited to 'config')
-rw-r--r--config/config.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/config/config.go b/config/config.go
index 867c6fa..537626f 100644
--- a/config/config.go
+++ b/config/config.go
@@ -22,6 +22,7 @@ type UIConfig struct {
 }
 
 type AccountConfig struct {
+	Default string
 	Name    string
 	Source  string
 	Folders []string
@@ -63,14 +64,16 @@ func loadAccountConfig(path string) ([]AccountConfig, error) {
 			continue
 		}
 		sec := file.Section(_sec)
-		account := AccountConfig{Name: _sec}
+		account := AccountConfig{
+			Default: "INBOX",
+			Name:    _sec,
+			Params:  make(map[string]string),
+		}
 		if err = sec.MapTo(&account); err != nil {
 			return nil, err
 		}
 		for key, val := range sec.KeysHash() {
-			if key == "source" {
-				account.Source = val
-			} else if key == "folders" {
+			if key == "folders" {
 				account.Folders = strings.Split(val, ",")
 			} else if key != "name" {
 				account.Params[key] = val
f='/akkartik/mu/commit/html/032array.cc.html?h=hlt&id=672e3e50c6ed6de161e40aa256c3fc0f2b1f7cf9'>672e3e50 ^
672e3e50 ^






65361948 ^





672e3e50 ^
672e3e50 ^





c5ffb6e1 ^


65361948 ^
c5ffb6e1 ^
672e3e50 ^







65361948 ^




672e3e50 ^
672e3e50 ^



65361948 ^





672e3e50 ^
672e3e50 ^







672e3e50 ^
65361948 ^
c5ffb6e1 ^

65361948 ^

c5ffb6e1 ^
65361948 ^
672e3e50 ^
c5ffb6e1 ^




672e3e50 ^


65361948 ^
672e3e50 ^









65361948 ^




672e3e50 ^
672e3e50 ^





65361948 ^





672e3e50 ^
672e3e50 ^







65361948 ^
c5ffb6e1 ^
65361948 ^


672e3e50 ^
c5ffb6e1 ^
65361948 ^

672e3e50 ^





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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179