summaryrefslogtreecommitdiff
path: root/lib/format
AgeCommit message (Collapse)Author
2022-04-29dirlist: add format specifier to compact folder nameKoni Marti
Add the format specifier %N to the dirlist-format to display compacted folder names. A folder such as INBOX/WORK/PROJECT will be compacted to I/W/PROJECT in the directoy list. Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
2021-11-13messages: allow displaying email threadsy0ast
Display threads in the message list. For now, only supported by the notmuch backend and on IMAP when the server supports the THREAD extension. Setting threading-enable=true is global and will cause the message list to be empty with maildir:// accounts. Co-authored-by: Kevin Kuehler <keur@xcf.berkeley.edu> Co-authored-by: Reto Brunner <reto@labrat.space> Signed-off-by: Robin Jarry <robin@jarry.cc>
2021-11-06index: add this-week-time-formatRobin Jarry
Also allow specific time format for messages received within the last 7 days. Signed-off-by: Robin Jarry <robin@jarry.cc>
2021-11-05go.mod: change base git urlRobin Jarry
I'm not sure what are the implications but it seems required. Link: https://github.com/golang/go/issues/20883 Signed-off-by: Robin Jarry <robin@jarry.cc>
2021-10-28view,list: fix crash when viewing incomplete imap messagesRobin Jarry
With IMAP, due to an unidentified reason, some messages to not have any body accessible. When viewing them, aerc crashes: git.sr.ht/~sircmpwn/aerc/lib.usePGP lib/messageview.go:37 git.sr.ht/~sircmpwn/aerc/lib.NewMessageStoreView lib/messageview.go:67 git.sr.ht/~sircmpwn/aerc/commands/account.ViewMessage.Execute commands/account/view.go:45 git.sr.ht/~sircmpwn/aerc/commands.(*Commands).ExecuteCommand commands/commands.go:66 main.execCommand aerc.go:61 main.main.func2 aerc.go:160 aerc crashed: runtime error: invalid memory address or nil pointer dereference Check the pointer before dereferencing. Also, add a global check in ParseMessageFormat where a similar issue may occur. Signed-off-by: Robin Jarry <robin@jarry.cc>
2021-10-28index: allow dynamic formatting of message datesRobin Jarry
When a message has been sent today (or this year) allow formatting the date differently. For example, with: [ui] index-format=%-25.25n %-25.25D %s timestamp-format=2006 Jan 02, 15:04 GMT-0700 this-day-time-format=Today at 15:04 this-year-time-format=Jan 02 The message list would look like this (spaces collapsed): Robin Jarry Today at 16:30 [PATCH 1/2] bindings: prepare for more modifers bugzilla@dpdk.org Oct 26 [dpdk-dev] [Bug 839] pdump: any subsequent runs of pdump_autotest fail Holger Levsen 2020 Mar 15, 13:44 GMT+01 +1 (Re: FTP Team -- call for volunteers) Signed-off-by: Robin Jarry <robin@jarry.cc>
2020-11-14format: remove parse methods, use the one from go-messageReto Brunner
2020-11-14compose: use a proper header instead of a string mapReto Brunner
Prior to this commit, the composer was based on a map[string]string. While this approach was very versatile, it lead to a constant encoding / decoding of addresses and other headers. This commit switches to a different model, where the composer is based on a header. Commands which want to interact with it can simply set some defaults they would like to have. Users can overwrite them however they like. In order to get access to the functions generating / getting the msgid go-message was upgraded.
2020-11-14remove models.Address in favor of go-message AddressReto Brunner
We made a new type out of go-message/mail.Address without any real reason. This suddenly made it necessary to convert from one to the other without actually having any benefit whatsoever. This commit gets rid of the additional type
2020-10-14refactor ParseMessageFormat to use a ctx objectReto Brunner
2020-09-10fix comment in ParseAddressListReto Brunner
Go pre 1.15 parsed an empty string as an error, 1.15 did not but this was unintentional as per https://github.com/golang/go/issues/40803 Fix the comment accordingly
2020-08-24ParseAddressList: return empty list if "" is providedReto Brunner
Go 1.15 handles "" in the address parser as a non error case, returning an empty list. Prior versions returned an error, which is not what we want. Reported-by: anianz <a.ziegler@cioplenu.de> Tested-by: anianz <a.ziegler@cioplenu.de>
2020-08-22Localize timestamps in the message listReto Brunner
Not sure we need a flag for it, most people expect times to be in their local time anyhow.
2020-08-20base models.Address on the mail.Address typeReto Brunner
This allows us to hook into the std libs implementation of parsing related stuff. For this, we need to get rid of the distinction between a mailbox and a host to just a single "address" field. However this is already the common case. All but one users immediately concatenated the mbox/domain to a single address. So this in effects makes it simpler for most cases and we simply do the transformation in the special case.
2020-08-10improve date parsing for notmuch/maildirReto Brunner
If a message date would fail to parse, the worker would never receive the MessageInfo it asked for, and so it wouldn't display the message. The problem is the spec for date formats is too lax, so trying to ensure we can parse every weird date format out there is not a strategy we want to pursue. On the other hand, preventing the user from reading and working with a message due to the error format is also not a solution. The maildir and notmuch workers will now fallback to the internal date, which is based on the received header if we can't parse the format of the Date header. The UI will also fallback to the received header whenever the date header can't be parsed. This patch is based on the work done by Lyudmil Angelov <lyudmilangelov@gmail.com> But tries to handle a parsing error a bit more gracefully instead of just returning the zero date.
2020-07-03Fix a nil Envelope when getting the formatAndrew Jeffery
When getting the format for a message the envelope can be nil and this shouldn't crash the program.
2019-12-27Add labels to index format (%g)Reto Brunner
Exposes the notmuch tags accordingly, stubs it for the maildir worker.
2019-12-22fix invalid format stringReto Brunner
2019-12-21msglist: highlight marked messagesReto Brunner
Note that, until we get color configuration, this means that the user *must* have the %Z verb in the index format else it'll be horribly confusing as no visual indication is provided
2019-11-25Fix crash if there is no to address for %FThorben Günther
2019-11-17Complete the F rune.Srivathsan Murali
%F now shows the auth name or recepient name/address if the message is from you.
2019-07-26Add new-email triggerJeffas
This patch sets up the trigger config section of aerc.conf. Each trigger has its own function which is called from the place where it is triggered. Currently only the new-email trigger is implemented. The triggers make use of format strings. For instance, in the new-email trigger this allows the user to select the trigger command and also the information extracted from the command and placed into their command. To actually execute the trigger commands the keypresses are simulated. Further triggers can be implemented in the future. Formatting of the command is moved to a new package.