aboutsummaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
Diffstat (limited to 'commands')
-rw-r--r--commands/msg/invite.go2
-rw-r--r--commands/msg/reply.go7
2 files changed, 3 insertions, 6 deletions
diff --git a/commands/msg/invite.go b/commands/msg/invite.go
index 37a194a6..4b2507f4 100644
--- a/commands/msg/invite.go
+++ b/commands/msg/invite.go
@@ -48,7 +48,7 @@ func (invite) Execute(aerc *widgets.Aerc, args []string) error {
return fmt.Errorf("no invitation found (missing text/calendar)")
}
- subject := trimLocalizedRe(msg.Envelope.Subject)
+ subject := trimLocalizedRe(msg.Envelope.Subject, acct.AccountConfig().LocalizedRe)
switch args[0] {
case "accept":
subject = "Accepted: " + subject
diff --git a/commands/msg/reply.go b/commands/msg/reply.go
index f577a963..bd57f4b1 100644
--- a/commands/msg/reply.go
+++ b/commands/msg/reply.go
@@ -158,7 +158,7 @@ func (reply) Execute(aerc *widgets.Aerc, args []string) error {
recSet.AddList(cc)
}
- subject := "Re: " + trimLocalizedRe(msg.Envelope.Subject)
+ subject := "Re: " + trimLocalizedRe(msg.Envelope.Subject, conf.LocalizedRe)
h := &mail.Header{}
h.SetAddressList("to", to)
@@ -331,9 +331,6 @@ func addMimeType(msg *models.MessageInfo, part []int,
}
// trimLocalizedRe removes known localizations of Re: commonly used by Outlook.
-func trimLocalizedRe(subject string) string {
+func trimLocalizedRe(subject string, localizedRe *regexp.Regexp) string {
return strings.TrimPrefix(subject, localizedRe.FindString(subject))
}
-
-// localizedRe contains a list of known translations for the common Re:
-var localizedRe = regexp.MustCompile(`(?i)^((AW|RE|SV|VS|ODP|R): ?)+`)