aboutsummaryrefslogtreecommitdiffstats
path: root/commands/msg
diff options
context:
space:
mode:
authorJohannes Thyssen Tishman <johannes@thyssentishman.com>2024-09-30 17:52:38 +0200
committerRobin Jarry <robin@jarry.cc>2024-10-12 00:13:10 +0200
commit7c50ee0de671535afca7e7133aaaed58e3037b29 (patch)
treec68279afe16a50a520dc6fcd446fe6e70ea777aa /commands/msg
parent835493b0bb86b66e8dd12f5bf2dd9d785e7f152f (diff)
downloadaerc-7c50ee0de671535afca7e7133aaaed58e3037b29.tar.gz
reply: make {{.OriginalText}} available to custom templates
Currently {{.OriginalText}} is only available to the quote-reply template when using `:reply -q`. Allow templates specified using the `-T` flag to make use of it too. Changelog-changed: Templates passed to the `:reply` command using the `-T` flag can now make use of `{{.OriginalText}}`. Signed-off-by: Johannes Thyssen Tishman <johannes@thyssentishman.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'commands/msg')
-rw-r--r--commands/msg/reply.go14
1 files changed, 6 insertions, 8 deletions
diff --git a/commands/msg/reply.go b/commands/msg/reply.go
index 2654514e..aeb186f8 100644
--- a/commands/msg/reply.go
+++ b/commands/msg/reply.go
@@ -212,11 +212,11 @@ func (r reply) Execute(args []string) error {
return nil
}
- if r.Quote {
- if r.Template == "" {
- r.Template = config.Templates.QuotedReply
- }
+ if r.Quote && r.Template == "" {
+ r.Template = config.Templates.QuotedReply
+ }
+ if r.Template != "" {
var fetchBodyPart func([]int, func(io.Reader))
if isMsgViewer {
@@ -229,7 +229,7 @@ func (r reply) Execute(args []string) error {
if crypto.IsEncrypted(msg.BodyStructure) && !isMsgViewer {
return fmt.Errorf("message is encrypted. " +
- "can only quote reply from the message viewer")
+ "can only include reply from the message viewer")
}
part := getMessagePart(msg, widget)
@@ -259,9 +259,7 @@ func (r reply) Execute(args []string) error {
return nil
} else {
- if r.Template == "" {
- r.Template = config.Templates.NewMessage
- }
+ r.Template = config.Templates.NewMessage
return addTab()
}
}