diff options
author | john1doe@ya.ru <john1doe@ya.ru> | 2022-01-31 16:28:58 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-01-31 16:22:54 +0100 |
commit | 27122ef8e885f6824afd395c0c0b7b4f19f71b21 (patch) | |
tree | d158fb435aeefce3ff1e103d7ccafaa2839f128b /commands/msg | |
parent | 622802d3a5ea980b2d08ffec91497b57d3bae7f4 (diff) | |
download | aerc-27122ef8e885f6824afd395c0c0b7b4f19f71b21.tar.gz |
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/msg')
-rw-r--r-- | commands/msg/reply.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/commands/msg/reply.go b/commands/msg/reply.go index a7768372..dac9f7a6 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 { |