summaryrefslogtreecommitdiff
path: root/widgets/account.go
AgeCommit message (Collapse)Author
2022-07-26fixup: Hack up message list to be sorted ascendingtopic/asc_sort_imapcos
An attempt at making ascending or descending message list configurable. Seems to work for me, but a proper take on this might need to involve having to rethink what configuration options to present and how direct they map towards the operations happening under the hood.
2022-07-10threading: add force-client-threads optionTim Culverhouse
This patch adds a config option to force the use of client side threads. This option will override a servers Thread capability, and only build threads on the client. It can be enabled contextually. For example: [ui] threading-enabled = true [ui:folder~^Archive] force-client-threads = true This config would enable threads for all views, and use client threads for folders that start with Archive. This can be advantageous if, for example, the folder is very large and the server has a slow response due to building threads for the entire mailbox Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
2022-07-10statusline: show threading status if threading-enabled=trueTim Culverhouse
Update statusline to display threading status at startup. Previously, the threading status would only display from a :toggle-threads command. Users who had the config option threading-enabled would not see the status, as a result. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
2022-07-03perf: reduce calls to GetUiConfigTim Culverhouse
GetUiConfig was being called many times, and came up as a high CPU user in a cpuprofile. Every call would merge a UIConfig, which is a costly operation. Ideally, we would only need to have a config for every account X every directory. We also have a context for subjects. This patch stores all FOLDER and ACCOUNT level configs and reuses those merged objects. The SUBJECT contexts are not stored in favor of merging on-the-go, with a TODO comment to deprecate that feature and implement a better per-message styling option. I suspect this feature is not used very much. Before applying this patch with my setup, GetUiConfig is called 1159 times just to open aerc. After applying, this is reduced to 37. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
2022-07-03uiconfig: use pointer references to uiConfigTim Culverhouse
This patch changes references to uiConfig in function signatures and structs to be pointers. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
2022-06-07dirlist: fix panic when disconnecting with dirlist-tree=falseTim Culverhouse
Commit 2027223a created a panic when attempting to clear the dirlist when the config option dirlist-tree is set to false. This patch fixes that panic by creating a dirlist.ClearList() function to prevent needing to check a callback. Tested with both dirlist-tree=false and true Fixes: 2027223ab302 ("fix: clear dirlist on disconnect") Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
2022-06-07fix: clear dirlist on disconnectTim Culverhouse
A message of Done:Disconnect will trigger an update of the dirlist. An update of the dirlist will issue a ListDirectories message, which causes an imap: client not ready error by trying to use the imap connection - which is disconnected. By not issuing the update, we prevent using a disconnected client. This patch checks for connection state prior to updating the dirlist. A disconnected state will clear out the dirlist. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
2022-06-07dirlist: update RUE counts for imap/maildir on move|copy|delete|archiveTim Culverhouse
When moving/copying/deleting/archiving a message in imap, the RUE counts displayed in the dirlist would not update properly. Maildir has (had) an implementation that recounts the entire directory and updates the DirectoryInfo after one of these actions. This patch implements a more efficient method of updating, and also enables it to apply to IMAP without any additional requests. Upon completion of the action, the counts are manually updated with the count of messages in the action and recent and/or unseen states of those messages. This is more efficient for maildir, because we aren't counting everything in the store. For IMAP, we get the updates for free because we are only performing the update after confirmation from the server that the action has happened. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
2022-05-31feat: add background mail polling option for all workersTim Culverhouse
Check for new mail (recent, unseen, exists counts) with an external command, or for imap with the STATUS command, at start or on reconnection and every X time duration IMAP: The selected folder is skipped, per specification. Additional config options are included for including/excluding folders explicitly. Maildir/Notmuch: An external command will be run in the background to check for new mail. An optional timeout can be used with maildir/notmuch. Default is 10s New account options: check-mail check-mail-cmd (maildir/notmuch only) check-mail-timeout (maildir/notmuch only), default 10s check-mail-include (IMAP only) check-mail-exclude (IMAP only) If unset, or set less than or equal to 0, check-mail will be ignored Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Moritz Poldrack <moritz@poldrack.dev> Acked-by: Robin Jarry <robin@jarry.cc>
2022-04-25statusline: refactor to make it more customizableKoni Marti
Refactor statusline by clearly separating the rendering part from the text display. Use printf-like format string for statusline customization. Document printf-like format string to customize the statusline. Allow to completely mute the statusline (except for push notifications) with a format specifier. Provide a display mode with unicode icons for the status elements. Implements: https://todo.sr.ht/~rjarry/aerc/34 Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
2022-03-25sort: keep sort criteria applied to folderKoni Marti
Keep the sort criteria applied to the selected folder until the default sort order should be restored. Call the sort command without arguments to restore the default sort order. The current behavior is that the default sort order is restored as soon as the folder reloads. This happens often and then the results of the sort command are lost. This makes the sort command not very user-friendly. Instead, we should keep the sort criteria applied until the user explicitly wants to restore the default sort order again. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
2022-03-25statusline: improve status line updatingKoni Marti
Update statusline only for the selected account (to prevent other updates from different accounts to interfere). Update status when jumping/selecting/closing tabs. Fixes cosmetic regressions introduced by commit feecc09b73e2 ("statusline: make statusline folder-specific"). Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
2022-03-24logging: fix race condition in startupMoritz Poldrack
If a panic occurs in one of the workers, it can happen after the UI was initialised, but before the cleanup function has been registered. With this the start of the worker loops is deferred until the cleanup routine was registered. Signed-off-by: Moritz Poldrack <git@moritz.sh>
2022-03-23logging: added a log on panicMoritz Poldrack
Since panics still regularly "destroy" the terminal, it is hard to get a stack trace for panics you do not anticipate. This commit adds a panic handler that automatically creates a logfile inside the current working directory. It has to be added to every goroutine that is started and will repair the terminal on a panic. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
2022-03-23statusline: make statusline folder-specificKoni Marti
Make statusline folder-specific. Update filter, search and threading status when changing folders. Commit 2512c04 ("statusline: implement per-account status") introduced an account-specific statusline. This makes it account- and folder-specific. Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Moritz Poldrack <moritz@poldrack.dev>
2022-03-20statusline: update status only when necessaryKoni Marti
Update statusline only when changed to reduce cpu usage. commit 2512c0403fa4 ("statusline: implement per-account status") updates the status irrespective of whether the statusline changed or not. This can lead to high cpu usage that can be avoided. Reported-by: Jens Grassel <jens@wegtam.com> Reported-by: inwit <inwit@sindominio.net> Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
2022-03-18statusline: implement per-account statusKoni Marti
Implement a statusline state for each account. Keep the ex line and the push notifications global. Add account name prefix to push notifications. Prefix status line with account name when multiple accounts are available. Use account-specific status line for each tab where an account is defined. Handle threading, filter/search, viewer passthrough and connection status. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
2022-03-18go vet: composite literal uses unkeyed fieldsMoritz Poldrack
This commit fixes all occurrences of the abovementioned lint-error in the codebase. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
2022-02-23dirtree: implement foldable tree for directory listKoni Marti
implement a foldable tree for the directory list. Expand all parent directories when a hidden directory is selected with the change-folder command. folders-sort considers the top-level directories only. The folders and foldersexclude filters work with the full directory path. Enable tree view by adding 'dirlist-tree=true' to the config file. Implements: https://todo.sr.ht/~sircmpwn/aerc2/228 Signed-off-by: Koni Marti <koni.marti@gmail.com>
2022-02-06imap: improve reconnect stabilityKoni Marti
improves the robustness of the imap reconnect feature which was introduced in commit beae17a6da37 ("imap: auto-reconnects on connection error"). If a connection error is emitted, the message list is cleared and a corresponding error message is shown in the ui. Status bar is updated as well. Upon reconnect, the directories and the message list will be re-fetched (same behavior as the connect command). Reconnect can be enabled and disabled with the connect and the disconnect commands. Signed-off-by: Koni Marti <koni.marti@gmail.com>
2022-01-19imap: auto-reconnects on connection errorKoni Marti
if the worker emits a connection error, the ui will automatically send back a reconnect command. The worker then establishes a new connection. Auto-reconnect is disabled when the user sends the disconnect command. Fixes: https://todo.sr.ht/~rjarry/aerc/1 Signed-off-by: Koni Marti <koni.marti@gmail.com>
2022-01-19imap: emits connection error on logoutKoni Marti
implements a new connection error message. This allows the worker to emit a connection-related error message to the ui when the imap client closes the loggedOut channel. Signed-off-by: Koni Marti <koni.marti@gmail.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-05imap: add manual {dis,}connect supportRobin Jarry
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>
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-08-19Add support for :rmdirARaspiK
The `:rmdir` command removes the current directory (`-f` is required if the directory is not empty). This is not supported on the notmuch backend. An issue with the maildir backend is that some sync programs (e.g. offlineimap) may recover the directory after it is deleted. They need to specifically be configured to accept deletions, or special commands need to be executed (e.g. `offlineimap --delete-folder`) to properly delete folders. A danger of using this on the IMAP backend is that it is possible for a new message to be added to the directory and for aerc to not show it immediately (due to a slow connection) - using `:rmdir` at this moment (with `-f` if the directory already contains messages) would delete the directory and the new message that just arrived (and all other contents). This is documented in aerc(1) so that users are aware of possible risks.
2020-08-10show error if account view creation failsReto Brunner
This can happen for example if aerc is compiled without notmuch support but the notmuch worker is requested. Pushing a status message isn't good enough, as this gets overridden pretty quickly if one has multiple accounts configured. So we show a fullscreen error instead.
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-09Use PushStatus instead of SetStatus where it makes senseHeiko Carrasco
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-28Revert "Remove duration from the status methods"Drew DeVault
This reverts commit f06d683688e3d2139b14f67b7e349089e7200bf4.
2020-05-27Remove duration from the status methodsReto Brunner
We always set 10 seconds anyhow, might as well do that without repeating ourselfs.
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-11Change MarkedMessages to return uidsReto Brunner
Especially if one tries to interact with all marked messages there could be the case that not all headers are fetched yet, hence the messageInfo is still nil. This segfaults a lot of commands which in principle only need the uid to complete. If we switch to uids, this issue can be alleviated for those commands.
2020-04-24Add recall commandJeffas
This command allows recalling the selected postponed email to edit in the composer. The command only allows recalling from the postpone directory.
2020-02-28Set the store on the message list if it is nilJeffas
2020-02-28Don't set the store on an update to itJeffas
Updates to a store can be asynchronous so we shouldn't select it just because it had an update. Selection of the stores should be driven by explicit user commands.
2020-02-19Revert "Only fetch the directory contents when we are switching directories"Reto Brunner
This reverts commit bd4df530095ee343778a59120a9e641c01010b0f. I did not properly untangle the opening / dirlist update of each other. This interferes with the imap worker, hence the revert
2020-02-16Only fetch the directory contents when we are switching directoriesReto Brunner
Previously, sending a DirectoryInfo assumed that a directory change happened. However we don't want that if we only want to update the unread message count.
2020-01-28dirlist: adapt to dynamic UIconfigReto Brunner
2020-01-24config: Strongly type context typeReto Brunner
The go compiler can't help much with untyped int constants. Even though the only valid constants are 0-3 it will happily accept 4 as input. Let's let the go compiler worry about correctness here. This also allows people not very familiar with the code to use it properly via auto completion.
2020-01-24Contextual UI ConfigurationSrivathsan Murali
+ Adds parsing of contextual ui sections to aerc config. + Add GetUiConfig method for AercConfig that is used to get the specialized UI config. + Add UiConfig method to AccountView to get specialized UI Config. + Modifies Aerc codebase to use specialized UIConfig instead. + Adds documentation for Contextual UI Configuration
2019-12-21add LabelList eventReto Brunner
2019-12-21AccountView: implement ProvidesMessagesReto Brunner
2019-09-20Add sorting functionalityJeffas
There is a command and config option. The criteria are a list of the sort criterion and each can be individually reversed. This only includes support for sorting in the maildir backend currently. The other backends are not supported in this patch.
2019-09-11Fix segfault on deleteDevon Johnson