summary refs log tree commit diff stats
path: root/config/config.go
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/config.go
parentb181e0449d552a03db49da8e3edace9b3d7cfaa6 (diff)
downloadaerc-77c76ba46296f57f88c591a420e929a059a55d3e.tar.gz
Implement default in accounts.conf
Diffstat (limited to 'config/config.go')
-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