summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
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-28view,compose: use border color to separate headers from bodyRobin Jarry
When composing a message, there is an empty fill line between the headers and the text editor. The line is printed with the default style which may cause users to assume it is part of the editor. Display the fill lines with the border color to avoid confusion. 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>
2021-08-30lib/ui/textinput: Optimize ensureScrollAdnan Maolood
2021-03-07FindFirstNonMultipart: return the proper pathReto Brunner
There was a bug that lead to the wrong path being returned by the function.
2021-02-26Fix linter warningsReto Brunner
* Remove redundant return (code was never reached) * Remove redundant type information * Rename unused function parameters to "_"
2021-01-30Refactor lib/open to accept user provided argumentsReto Brunner
* Get rid of open_darwin It just lead to code duplication for a simple one string change. Instead we query it during initialization * Accept user provided arguments "open" on MacOS accepts things like -A to use a specific application Pass trough arguments the user provided in order to facilitate this * Refactor the function to a struct This makes it more convenient for the caller and avoids signatures like lib.OpenFile(nil, u.String(), nil) which are fairly unreadable
2020-12-18update tcell to v2 and enable TrueColor supporty0ast
Also update to the tcell v2 PaletteColor api, which should keep the chosen theme of the user intact. Note, that if $TRUECOLOR is defined and a truecolor given, aerc will now stop clipping the value to one of the theme colors. Generally this is desired behaviour though.
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-14templates: Remove ParseTemplate as it's unusedReto Brunner
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-11-11templates: better error messageReto Brunner
2020-10-14refactor ParseMessageFormat to use a ctx objectReto Brunner
2020-09-10Remove unused Simulator interfaceReto 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-13Add `oauthbearer` support for SMTPR Chowdhury
This piggybacks on the existing IMAP support, and uses the same configuration format (my local testing example has the IMAP and SMTP lines almost copy-pasted from one another). It's a little clumsy in that a new token is negotiated for every `Send()` command, but it's a start...
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-08-06Implement style configuration.Kalyan Sriram
Introduce the ability to configure stylesets, allowing customization of aerc's look (color scheme, font weight, etc). Default styleset is installed to /path/to/aerc/stylesets/default.
2020-07-30Revert "Implement style configuration."Reto Brunner
This reverts commit 1ff687ca2b0821c2cacc1fa725abb3302d2af9da.
2020-07-30Implement style configuration.Kalyan Sriram
Introduce the ability to configure stylesets, allowing customization of aerc's look (color scheme, font weight, etc). Default styleset is installed to /path/to/aerc/stylesets/default.
2020-07-27Remove hard coded bodystruct path everywhereReto Brunner
Aerc usually used the path []int{1} if it didn't know what the proper path is. However this only works for multipart messages and breaks if it isn't one. This patch removes all the hard coding and extracts the necessary helpers to lib.
2020-07-17run go fmtReto Brunner
2020-07-10Remove deleted messages from search/filter resultsAndrew Jeffery
This ensures that when moving/deleting messages with a filter active the view gets updated properly.
2020-07-08Add additional flagging functionalityARaspiK
More mail flags can now be set, unset, and toggled, not just the read/seen flag. This functionality is implemented with a new `:flag` and `:unflag` command, which are extensions to the matching `:read` and `:unread` commands, adding support for different flags. In fact, the `read`/`unread` commands are now recognized aliases to `flag`/`unflag`. The new commands are also well documented in aerc(1). The change mostly extends the previous read/unread setting functionality by adding a selection for the flag to change.
2020-07-08Allow open to be asynchronousAndrew Jeffery
This stops the ui being blocked while the resource is opened. The wait ensures that resources are reclaimed when the process finishes while aerc is still running.
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.
2020-06-26Fix dates in reply/forward commands.Reto Brunner
The data was passed around as a string for some reason, which led to time precision loss and wrong dates being displayed. Simply pass the time as is to fix that.
2020-06-09Make grid sizes dynamicJeffas
The grid used static sizes which meant that changing settings didn't have an effect on elements of the ui, notably the sidebar width. This patch makes the `Size` parameter of a cell a function which returns the `int`, allowing for dynamic sizes. A `Const` function is also included for ease of use for static sizes.
2020-05-28Revert "Add Style configuration"Drew DeVault
This reverts commit 0f78f06610c0e8887aba2ae50e99b86477a384b3.
2020-05-27Add Style configurationReto Brunner
The following functionalities are added to configure aerc ui styles. - Read stylesets from file with very basic fnmatch wildcard matching - Add default styleset - Support different stylesets as part of UiConfig allowing contextual styles. - Move widgets/ui elements to use the stylesets. - Add configuration manual for the styleset
2020-05-25Set AnsweredFlag on successful replySrivathsan Murali
2020-05-25pgp: fail gracefully from email decryptionRay Ganardi
Aerc panics when there's an error on email decryption. Instead, an error message should be shown.
2020-05-17FetchBodyPart doesn't need the parent body structureReto Brunner
2020-05-16imap: Remove FetchMessageBodyPart.{Encoding,Charset}Reto Brunner
Fixes https://todo.sr.ht/~sircmpwn/aerc2/352 exactly as suggested by emersion.
2020-05-06templates: add version funcReto Brunner
Fixes #316
2020-05-06lib/messageview: mark messages as readReto Brunner
Currently at least the notmuch and maildir worker only set messages as read if a body part is fetched. The gpg abstraction however fetches the full message. We can simply set the readstate when we create the messageview, avoiding the issue. Once this is merged, we can cleanup both workers.
2020-05-05libui: don't require beeper for main contentDrew DeVault
2020-05-05Fix array out of bounds errorburrowing-owl
2020-05-01store.FetchFull: Change callback type to expose entire messageBen Fiedler
This is a prerequisite for allowing the FetchFull message to return both the message content and the message headers.
2020-04-24Remove ability to specify headers in the editorReto Brunner
Due to headers being essentially free text, we constantly run into issues with parts of the body being interpreted as headers. Remove the ability to overwrite headers to avoid that, while keeping the ability to specify headers in the template files. Fixes #383
2020-04-20fix: Close unused MessageView when swapping viewRay Ganardi
Closes https://todo.sr.ht/~sircmpwn/aerc2/379 The old `MessageView` was not closed when replacing the tab content, which causes a memory leak.
2020-03-09Add pinned tabsJeffas
This adds the commands pin-tab and unpin-tab. Once pinned a tab lives on the left of the tabstrip and has a configurable marker, defaulting to ` before its name.
2020-03-03Initial support for PGP decryption & signaturesDrew DeVault
2020-03-03Add move-tab commandJeffas
2020-02-29remove the dirInfoUpdateRequest functionalityReto Brunner
The notmuch worker followed suit in handling the dirInfo submission manually. That removes the last user so we might as well remove the functionality.