~sircmpwn/aerc

Add account option to sign before quote v1 PROPOSED

Afonso Raposo: 1
 Add account option to sign before quote

 2 files changed, 12 insertions(+), 4 deletions(-)
Hi,

I completely understand.
Using templates for this is a great suggestion. Thank you!

Kind regards,

Afonso

On Tue Mar 30, 2021 at 7:01 AM WEST, Reto wrote:
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/aerc/patches/21609/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH] Add account option to sign before quote Export this patch

---
I typically prefer to have my signature right after my message, so I
added an account option to add the signature before the quoted email.
 config/config.go   |  1 +
 widgets/compose.go | 15 +++++++++++----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/config/config.go b/config/config.go
index 8b409fe..cdb0905 100644
--- a/config/config.go
+++ b/config/config.go
@@ -86,6 +86,7 @@ type AccountConfig struct {
	OutgoingCredCmd string
	SignatureFile   string
	SignatureCmd    string
    SignBeforeQuote bool
	FoldersSort     []string `ini:"folders-sort" delim:","`
}

diff --git a/widgets/compose.go b/widgets/compose.go
index 01c6281..f54de3d 100644
--- a/widgets/compose.go
+++ b/widgets/compose.go
@@ -106,10 +106,17 @@ func NewComposer(aerc *Aerc, acct *AccountView, conf *config.AercConfig,
	}
	c.buildComposeHeader(aerc, cmpl)

	if err := c.AddTemplate(template, templateData); err != nil {
		return nil, err
	}
	c.AddSignature()
    if acctConfig.SignBeforeQuote {
        c.AddSignature()
        if err := c.AddTemplate(template, templateData); err != nil {
            return nil, err
        }
    } else {
        if err := c.AddTemplate(template, templateData); err != nil {
            return nil, err
        }
        c.AddSignature()
    }

	c.updateGrid()
	c.ShowTerminal()
-- 
2.31.1
Hi,
Thanks for the patch.

On Tue, Mar 30, 2021 at 12:02:47AM +0100, Afonso Raposo wrote: