aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
Commit message (Collapse)AuthorAgeFilesLines
* dirlist: actually honor the DirInfoReto Brunner2020-02-161-25/+36
| | | | | | | | | | | | Currently the dirlist ignores the counts provided by the dirInfo. However some of the workers can actually provide accurate counts much quicker than if we count the flags. Eventually we will also want to enable displaying counts for background folders, where the brute force counting won't work as none of the headers are fetched yet. This commit models it in an opt-in manner, if the flag isn't set then we still count the messages manually.
* Only fetch the directory contents when we are switching directoriesReto Brunner2020-02-162-1/+18
| | | | | | 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.
* Ensure we aren't selecting negative directoriesAndreas Rammhold2020-02-071-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the list of directories is empty trying to navigate in the directory list did previously lead to a crash. With this change we instead return early before trying to change the directory. Example backtrace: > panic: runtime error: index out of range [-1] > > goroutine 1 [running]: > git.sr.ht/~sircmpwn/aerc/widgets.(*DirectoryList).NextPrev(0xc000160680, 0xffffffffffffffff) > source/aerc/widgets/dirlist.go:285 +0xd4 > git.sr.ht/~sircmpwn/aerc/commands/account.NextPrevFolder.Execute(0xc000191040, 0xc00025c210, 0x1, 0x1, 0x0, 0xc00016f420) > source/aerc/commands/account/next-folder.go:44 +0xe0 > git.sr.ht/~sircmpwn/aerc/commands.(*Commands).ExecuteCommand(0xc0000101a8, 0xc000191040, 0xc00025c210, 0x1, 0x1, 0xc000020070, 0xb46d01) > source/aerc/commands/commands.go:66 +0xa7 > main.execCommand(0xc000191040, 0xc0001ca190, 0xc00025c210, 0x1, 0x1, 0xc00025c210, 0xc0003fb080) > source/aerc/aerc.go:60 +0xc7 > main.main.func3(0xc00025c210, 0x1, 0x1, 0x1, 0x1) > source/aerc/aerc.go:162 +0x57 > git.sr.ht/~sircmpwn/aerc/widgets.(*Aerc).BeginExCommand.func1(0xc000201db0, 0xb) > source/aerc/widgets/aerc.go:382 +0x83 > git.sr.ht/~sircmpwn/aerc/widgets.(*ExLine).Event(0xc0003be100, 0xb475a0, 0xc00023cba0, 0xc00023cba0) > source/aerc/widgets/exline.go:79 +0x131 > git.sr.ht/~sircmpwn/aerc/widgets.(*Aerc).Event(0xc000191040, 0xb475a0, 0xc00023cba0, 0x99ee01) > source/aerc/widgets/aerc.go:202 +0x4c1 > git.sr.ht/~sircmpwn/aerc/widgets.(*Aerc).simulate(0xc000191040, 0xc000036f00, 0xd, 0x10) > source/aerc/widgets/aerc.go:195 +0x8d > git.sr.ht/~sircmpwn/aerc/widgets.(*Aerc).Event(0xc000191040, 0xb475a0, 0xc00023c9c0, 0x9c5a60) > source/aerc/widgets/aerc.go:218 +0x3e8 > git.sr.ht/~sircmpwn/aerc/lib/ui.(*UI).Tick(0xc0001ca190, 0xa99d00) > source/aerc/lib/ui/ui.go:92 +0x190 > main.main() > source/aerc/aerc.go:192 +0x5f2
* dirlist: adapt to dynamic UIconfigReto Brunner2020-01-282-11/+21
|
* dirlist: remove not needed sort functionReto Brunner2020-01-281-2/+1
| | | | | | | | | | The docs of strings.Compare state: > Compare is included only for symmetry with package bytes. It is usually > clearer and always faster to use the built-in string comparison operators > ==, <, >, and so on. So let's do that.
* config: Strongly type context typeReto Brunner2020-01-242-3/+3
| | | | | | | | 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.
* Contextual UI ConfigurationSrivathsan Murali2020-01-243-10/+27
| | | | | | | | | + 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
* Display the mimetype when offering to pipe or saveLuke Drummond2020-01-201-1/+3
|
* Switch back to upstream pty libraryBen Fiedler2020-01-161-1/+1
| | | | | The relevant change was merged upstream, and thus allows us to clean up unneeded forks.
* Correct spellingReto Brunner2020-01-161-1/+1
|
* remove Original* checkLeszek Cimała2020-01-091-2/+1
|
* create OriginalMail structLeszek Cimała2020-01-092-3/+5
|
* FetchBodyParts: decode source in the workersReto Brunner2020-01-051-23/+3
| | | | | | | Previously the workers returned a mixture of decoded / encoded parts. This lead to a whole bunch of issues. This commit changes the msgviewer and the commands to assume parts to already be decoded
* msgviewer: decode headers prior to displaying themReto Brunner2020-01-051-1/+7
|
* msgviewer: bypass filter for headersReto Brunner2020-01-051-3/+6
|
* msgviewer: do not anchor ansi escape to start of lineReto Brunner2020-01-051-1/+1
|
* msgviewer: Add Labels as a virtual headerReto Brunner2019-12-272-6/+26
| | | | | | In order to accommodate for that, the headerlayout needed to be rewritten to pass the filter criteria back to the msgviewer, instead of just using the normal headers.
* add LabelList eventReto Brunner2019-12-211-0/+7
|
* msglist: highlight marked messagesReto Brunner2019-12-211-1/+1
| | | | | | 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
* msgviewer: implement ProvidesMessages interfaceReto Brunner2019-12-211-0/+7
|
* AccountView: implement ProvidesMessagesReto Brunner2019-12-211-0/+7
|
* widgets: add msgInfoFromUids helperReto Brunner2019-12-211-0/+20
|
* add ProvidesMessages interfaceReto Brunner2019-12-211-0/+8
|
* Add address book completion in composerBen Burwell2019-12-211-3/+20
| | | | | Complete email address fields in the message composer with an external address book command, compatible with mutt's query_cmd.
* Show textinput completions in popoversBen Burwell2019-12-212-6/+13
| | | | | | Rather than showing completions inline in the text input, show them in a popover which can be scrolled by repeatedly pressing the tab key. The selected completion can be executed by pressing enter.
* Use timestamp-format in msgviewerBen Burwell2019-12-191-3/+3
| | | | | This allows the time to be displayed in a user-configurable way. Also localize the time in the message viewer as it is in the message list.
* Composer: fix EOF errorsDrew DeVault2019-12-121-6/+10
| | | | | PrepareHeaders generated a fresh message ID and Date header every time. This instead generates those headers in advance.
* Add custom sorting for foldersMichele Finotto2019-12-091-2/+34
| | | | | | | | | | | | | | A new config options for accounts.conf (folders-sort) was added to allow a user to choose which folders should be shown on top. My use case was to avoid stepping into heavy, but rarely viewed folders when cycling through other often accessed ones. To test add this to your account.conf: folders-sort = INBOX,Sent,Archive INBOX, Sent and Archive should then show at the top of your dirlist, and all other folders should come next in alphabetical order.
* remove garbage headers in reply messageLeszek Cimała2019-12-081-1/+2
| | | | | | Very important fix. Remove garbage from reply message headers. Till now all Original fields were send in reply, which we do not want and could lead to uncorrect email message.
* failback to Content-Type filename when encoded Content-Disposition is usedLeszek Cimała2019-12-071-0/+3
| | | | | | | | | | | | | | | | | | | | | Hi! This patch will fix missing filename if it is RFC2231 encoded with charset different then ASCII or UTF8. Example how it looks like in mail: Content-Type: application/pdf; name="=?UTF-8?Q?Opis_przedmiotu_zam=c3=b3wienia_-_za=c5=82=c4=85cznik_nr_1?= =?UTF-8?Q?=2epdf?=" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename*0*=iso-8859-2''%4F%70%69%73%20%70%72%7A%65%64%6D%69%6F%74%75%20; filename*1*=%7A%61%6D%F3%77%69%65%6E%69%61%20%2D%20%7A%61%B3%B1%63%7A%6E; filename*2*=%69%6B%20%6E%72%20%31%2E%70%64%66 Yes, this should be forbidden :-). Anyway, best solotion in such cases is to failback to Content-Type name. I am not sure if it is guaranted to be there, but probably it will. Leszek
* fix non-utf8 encoding in msgviewerernierasta2019-12-071-2/+2
| | | | | | | | This patch should fix encoding problem with non-utf8 text/plain mime. It is now correctly convert to utf8 before sending to pager. It will also solve quoting such mails. Leszek
* Parse headers from templateRobert Günzler2019-12-071-3/+50
| | | | | | | | | | | This patch parses the processed template for headers and populates matching header editors. Those are then stripped from the template body before prepending the template and remaining header fields to the composer content. The main motivation for this is keeping receiver, sender and subject lines in the template file and generating the message subject from the date.
* Revert "Parse headers from template"Drew DeVault2019-12-041-39/+3
| | | | This reverts commit 31e3e9f56e0b8123f0238537112496b407055aef.
* Parse headers from templateRobert Günzler2019-12-041-3/+39
| | | | | | | | | | | Parse the processed template for headers and populates matching header editors accordingly. Those are then stripped from the template body before prepending it and remaining header fields to the composer content. The motivation for this is keeping receiver, sender and subject lines in the template file and generating the message subject with the date functions.
* widgets/terminal: Reap more zombiesKevin Kuehler2019-11-211-0/+1
| | | | | | | The editor and pager were not properly being reaped, causing resource leakage whenever a user replies to a message. Signed-off-by: Kevin Kuehler <keur@xcf.berkeley.edu>
* Allow fields in compose widget to be clickedGreg Anders2019-11-171-2/+32
| | | | | When the mouse is enabled, clicking on a header field switches focus to that field (likewise for the terminal).
* Complete the F rune.Srivathsan Murali2019-11-171-0/+1
| | | | | %F now shows the auth name or recepient name/address if the message is from you.
* Add UI options to save/pipe messages with unsupported mimetypesGreg Anders2019-11-176-122/+161
| | | | | | | | | | | | | | | Adds a message indicating the user's ability to :save or :pipe a message with an unsupported mimetype and also adds a selector widget (similar to the tutorial). The selector widget was previously defined in the account wizard module, so this commit breaks it out into its own module to allow for re-use. Further, modify the BeginExLine() function to take an argument that pre-populates the command line, allowing functions to initiate an ex command without executing it. Closes #95.
* Check for terminal before forwarding mouse eventGreg Anders2019-11-171-1/+1
| | | | | | | When viewing a message part with no available filter, clicking the UI would cause a nil pointer dereference because the MouseEvent was passed to the PartViewer's `term` field, which does not exist in the case of an absent filter.
* Add some defaults for template optionsDrew DeVault2019-11-101-2/+4
|
* Add Templates with ParsingSrivathsan Murali2019-11-102-5/+39
| | | | | | | | | | | | | | | + Changes NewComposer to return error. + Add lib to handle templates using "text/template". + Add -T option to following commands - compose. - reply - forward + Quoted replies using templates. + Forwards as body using templates + Default templates are installed similar to filters. + Templates Config in aerc.conf. - Required templates are parsed while loading config. + Add aerc-templates.7 manual for using template data.
* widgets/msgviewer: Don't crash if pager is nilKevin Kuehler2019-11-101-1/+1
| | | | Signed-off-by: Kevin Kuehler <keur@xcf.berkeley.edu>
* widgets/msgview: Reap the filter commandKevin Kuehler2019-10-161-0/+1
| | | | | | | | The filter command shells out and returns almost immediately. Call Wait() so the filter process gets reaped. Prior to this patch, aerc creates a zombie process for every email that is viewed. Signed-off-by: Kevin Kuehler <keur@xcf.berkeley.edu>
* Cleanup pager processes after closing a msgviewerKevin Kuehler2019-10-161-0/+17
| | | | | | | | | A pager is spawned every time an email is viewed but not killed off when quitting the msgviewer, thus leading to process leakage. This patch fixes this by adding a Close method to the msgview widget, which is called in the close command. Signed-off-by: Kevin Kuehler <keur@xcf.berkeley.edu>
* Revert "Show spinner when fetching contents"Drew DeVault2019-10-091-3/+0
| | | | This reverts commit 1339faf7881f33762c6e0a4915404e362fc51de1.
* Show spinner when fetching contentsJeffas2019-10-091-0/+3
| | | | | The spinner should be shown when fetching the contents as we don't know at that point whether there are some messages or not.
* Fix selected account to return for messageviewerJeffas2019-10-021-4/+6
| | | | | | This ensures that the selectedaccount is returned if currently selected tab is a messageviewer. This also makes it more extensible for adding other ways of getting the selected account.
* Add sorting functionalityJeffas2019-09-201-0/+14
| | | | | | | | 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.
* Revert "Fix out-of-order messages by sorting as we display"Drew DeVault2019-09-181-31/+0
| | | | This reverts commit ac99d9ed62644cf0259bdd79481b28c3fbcef650.
* widgets: remove duplicate importWagner Riffel2019-09-121-18/+17
| | | | Signed-off-by: Wagner Riffel <wgrriffel@gmail.com>