aboutsummaryrefslogtreecommitdiffstats
path: root/config/config.go
diff options
context:
space:
mode:
Diffstat (limited to 'config/config.go')
-rw-r--r--config/config.go21
1 files changed, 17 insertions, 4 deletions
diff --git a/config/config.go b/config/config.go
index e40d964a..0de1780c 100644
--- a/config/config.go
+++ b/config/config.go
@@ -203,10 +203,11 @@ type BindingConfigContext struct {
}
type ComposeConfig struct {
- Editor string `ini:"editor"`
- HeaderLayout [][]string `ini:"-"`
- AddressBookCmd string `ini:"address-book-cmd"`
- ReplyToSelf bool `ini:"reply-to-self"`
+ Editor string `ini:"editor"`
+ HeaderLayout [][]string `ini:"-"`
+ AddressBookCmd string `ini:"address-book-cmd"`
+ ReplyToSelf bool `ini:"reply-to-self"`
+ NoAttachmentWarning *regexp.Regexp `ini:"-"`
}
type FilterConfig struct {
@@ -523,6 +524,18 @@ func (config *AercConfig) LoadConfig(file *ini.File) error {
if key == "header-layout" {
config.Compose.HeaderLayout = parseLayout(val)
}
+
+ if key == "no-attachment-warning" && len(val) > 0 {
+ re, err := regexp.Compile("(?im)" + val)
+ if err != nil {
+ return fmt.Errorf(
+ "Invalid no-attachment-warning '%s': %w",
+ val, err,
+ )
+ }
+
+ config.Compose.NoAttachmentWarning = re
+ }
}
}