~labrat

Recent activity

Re: [PATCH aerc v2] fix wrapText and quote, add exec, .OriginalMIMESubType var for templates 3 days ago

From Reto to ~sircmpwn/aerc

>- add OriginalMIMESubType string to template vars.

In my view you should leave the mimetype intact  meaning text/html  not just html.

Keep in mind that some people might want to do conditional logic based on that.

If you have text/* you can check for the prefix instead of needing a single case for every possible subtype (plus subtypes aren't guaranteed to be unique between major types either

Re: [PATCH] [template] Fix double >\n when quoting empty line 3 days ago

From Reto to ~sircmpwn/aerc

Duplicate of Message-Id: <20191210110419.11024-1-ernierasta@zori.cz> or the V1 version of the patch.

Also this is only an incomplete fix, a related issue being the terminating newline added by things like quote

Re: [PATCH aerc] fix quote, add stopAt, exec, provide IsHTML 4 days ago

From Reto to ~sircmpwn/aerc

On Mon, Dec 09, 2019 at 10:33:17AM +0100, Leszek Cimała wrote:
> You are right. It is because after last word in message, there will always
> be \n (am I right? claws-mail and aerc will add it even when I will end my
> message without \n at the end). This empty line would get multiplied by
> wrapText (it also always add \n to the end of string). So from what I tested
> need to be used in both functions:
>
> for _, line := range lines[:len(lines)-1] {
>
> Should be correct solution in that case.

Easier to read would probably be to simply strip whitespace at the beginning of the
function, same as all CR/LF are converted to \n line endings.

Re: [PATCH aerc] fix quote, add stopAt, exec, provide IsHTML 4 days ago

From Reto to ~sircmpwn/aerc

Hi,

On Sun, Dec 08, 2019 at 10:08:25PM +0100, Leszek Cimała wrote:
> As You can see, I have made "wrap" function, because template functions
> should always have OriginalText as last parameter, so You can use stand
> alone and chained.

The chainable version seems to be the saner version if you ask me...

Is it too late to sack the original implementation?

That would involve people updating their configs though...
But I don't really like having 2 functions do the exact same thing

Re: [PATCH aerc] remove garbage headers in reply message 5 days ago

From Reto to ~sircmpwn/aerc

On Sun, Dec 08, 2019 at 02:41:07PM -0500, Drew DeVault wrote:
> Well, alright. Thanks!

I'm not sure that this is the proper fix...
While it does solve the issue for now, I think this stems from a bad interaction
with the recently merged patch that allows specifying headers in the templates
and the template data.

Simply removing anything with a "Original" Prefix doesn't seem particularly robust
to me.

Re: [PATCH v2] Add custom sorting for folders 10 days ago

From Reto to ~sircmpwn/aerc

Hi,

Your patch breaks the NextPrev method, specifically the dirlist jumps around if you
use the next / prev methods on the dirlist (bound to J / K by default I think).

Currently the code assumes that the dirlist is sorted in order for the method to work

> func (dirlist *DirectoryList) NextPrev(delta int) {
>	curIdx := sort.SearchStrings(dirlist.dirs, dirlist.selected)
sort.SearchStrings uses binary search and needs the items in ascending order


Besides that, here's a few other remarks:

[PATCH] templates: untangle quoting from word wrapping a month ago

From Reto Brunner to ~sircmpwn/aerc

Prior to this patch the quoting always hard wrapped at 70 chars.
This commit separates the 2 concerns, wrapping and quoting.

It also fixes the wrapping of already quoted lines
---
 doc/aerc-templates.7.scd  | 11 +++++++---
 lib/templates/template.go | 44 ++++++++++++++++++++++++++++-----------
 templates/quoted_reply    |  2 +-
 3 files changed, 41 insertions(+), 16 deletions(-)

diff --git a/doc/aerc-templates.7.scd b/doc/aerc-templates.7.scd
index 8504a60..b8d4f5c 100644
--- a/doc/aerc-templates.7.scd
+++ b/doc/aerc-templates.7.scd
[message trimmed]

Re: Possibly useful: 'mailscripts' package a month ago

From Reto to ~sircmpwn/aerc

Cool, thanks for sharing :)

Re: [PATCH v4] Add Templates with Parsing a month ago

From Reto to ~sircmpwn/aerc

On Sun, Nov 03, 2019 at 10:21:51PM +0100, Srivathsan Murali wrote:
> > Are you sure you want the envelope from here?
> > Because for example the patch I'm replying to would have
> > <extsmtp@sr.ht> here, not <sri@vathsan.com>.
> > I'm not quite sure that this is the desired behaviour.
> Would using the reply-to addresses in envelope instead of from be more
> appropriate. 
> 
> I am still new to the codebase/email protocols, so glad to make changes
> on how this should work better.

Actually, Disregard what I said... what aerc calls Envelope here, isn't actually
the smtp envelope that I thought it was.

Re: [PATCH v4] Add Templates with Parsing a month ago

From Reto to ~sircmpwn/aerc

Very nice patch :)
Some questions:

> -	composer := widgets.NewComposer(aerc, aerc.Config(),
> -		acct.AccountConfig(), acct.Worker(), defaults)
> +	addTab := func() error {
> +		if template != "" {
> +			defaults["OriginalFrom"] = models.FormatAddresses(msg.Envelope.From)
Are you sure you want the envelope from here?
Because for example the patch I'm replying to would have <extsmtp@sr.ht> here,
not <sri@vathsan.com>.
I'm not quite sure that this is the desired behaviour.

> +			defaults["OriginalDate"] = msg.Envelope.Date.Format("Mon Jan 2, 2006 at 3:04 PM")