summaryrefslogtreecommitdiff
path: root/commands
diff options
context:
space:
mode:
authorjohn1doe@ya.ru <john1doe@ya.ru>2022-01-31 16:28:58 +0200
committerRobin Jarry <robin@jarry.cc>2022-01-31 16:22:54 +0100
commit27122ef8e885f6824afd395c0c0b7b4f19f71b21 (patch)
treed158fb435aeefce3ff1e103d7ccafaa2839f128b /commands
parent622802d3a5ea980b2d08ffec91497b57d3bae7f4 (diff)
downloadaerc-27122ef8e885f6824afd395c0c0b7b4f19f71b21.zip
compose: add option to never include your own address when replying
Introduce an option in aerc.conf to disable the auto-including of your own address when replying to your own emails (address replies to the original To: and Cc: instead); default to true (allow the auto-including)
Diffstat (limited to 'commands')
-rw-r--r--commands/msg/reply.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/commands/msg/reply.go b/commands/msg/reply.go
index a776837..dac9f7a 100644
--- a/commands/msg/reply.go
+++ b/commands/msg/reply.go
@@ -112,6 +112,19 @@ func (reply) Execute(aerc *widgets.Aerc, args []string) error {
} else {
to = msg.Envelope.From
}
+
+ if !aerc.Config().Compose.ReplyToSelf {
+ for i, v := range to {
+ if v.Address == from.Address {
+ to = append(to[:i], to[i+1:]...)
+ break
+ }
+ }
+ if len(to) == 0 {
+ to = append(msg.Envelope.To)
+ }
+ }
+
recSet.AddList(to)
if replyAll {