summaryrefslogtreecommitdiff
path: root/widgets/msgviewer.go
AgeCommit message (Collapse)Author
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-09-07Make mimetype check consistent across casesy0ast
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-06Rename selecter to selectorKalyan Sriram
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-30Revert "Rename selecter to selector"Reto Brunner
This reverts commit 2c244222d508a32d3f5ba600944a46b6fdea1a10.
2020-07-30Rename selecter to selectorKalyan Sriram
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-30msgviewer: set max line length to 1 GBReto Brunner
some people send around huge html without any newline in between. This did overflow the default 64KB buffer of bufio.Scanner. If something can't fit in a GB there's no hope left Also, ignoring errors is bad mkey
2020-07-30msgviewer: simplify attemptCopyReto Brunner
No functional changes, simply extract more complex stuff into sub functions to help readability.
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-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-17FetchBodyPart doesn't need the parent body structureReto Brunner
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-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-19msgviewer: do not interpret header as format stringDrew DeVault
2020-03-09Refactoring: remove store from PartInfoDrew DeVault
2020-03-03Initial support for PGP decryption & signaturesDrew DeVault
2020-02-25Fix crash on mouse scrolling between message partsAmir Yalon
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
2020-01-20Display the mimetype when offering to pipe or saveLuke Drummond
2020-01-05FetchBodyParts: decode source in the workersReto Brunner
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
2020-01-05msgviewer: decode headers prior to displaying themReto Brunner
2020-01-05msgviewer: bypass filter for headersReto Brunner
2020-01-05msgviewer: do not anchor ansi escape to start of lineReto Brunner
2019-12-27msgviewer: Add Labels as a virtual headerReto Brunner
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.
2019-12-21msgviewer: implement ProvidesMessages interfaceReto Brunner
2019-12-19Use timestamp-format in msgviewerBen Burwell
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.
2019-12-07failback to Content-Type filename when encoded Content-Disposition is usedLeszek CimaƂa
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
2019-12-07fix non-utf8 encoding in msgviewerernierasta
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
2019-11-17Add UI options to save/pipe messages with unsupported mimetypesGreg Anders
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.
2019-11-17Check for terminal before forwarding mouse eventGreg Anders
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.
2019-11-10widgets/msgviewer: Don't crash if pager is nilKevin Kuehler
Signed-off-by: Kevin Kuehler <keur@xcf.berkeley.edu>
2019-10-16widgets/msgview: Reap the filter commandKevin Kuehler
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>
2019-10-16Cleanup pager processes after closing a msgviewerKevin Kuehler
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>
2019-09-11Add MouseableJeffas
This adds the Mouseable interface. When this is implemented for a component that item can accept and process mouseevents. At the top level when a mouse event is received it is passed to the grid's handler and then it trickles down until it reaches a component that can actually handle it, such as the tablist, dirlist or msglist. A mouse event is passed so that components can handle other things such as scrolling with the mousewheel. The components themselves then perform the necessary actions. Clicking emails in the messagelist opens them in a new tab. Textinputs can be clicked to position the cursor inside them. Mouseevents are not forwarded to the terminal at the moment. Elements which do not handle mouse events are not required to implement the Mouseable interface.
2019-08-03Fixing #231 (alternative preferred mimetypes)Ben Cohen
2019-07-26Support configurable header layout in compose widgetDaniel Bridges
2019-07-19Fix alternatives configDrew DeVault
2019-07-17Add option to always show mimetype in viewerJeffas
A user may want to be able to see what mimetype they are viewing, so that they can determine what program it may be opened in or for some other reason. The config option is under the [viewer] section and is called 'always-show-mime'. It defaults to false to preserve the current behaviour.
2019-07-17Remove passing of showHeaders explicitlyJeffas
Where it is needed the configs are already available so just extract the value from these.
2019-07-17Ensure new partswitcher doesn't start on multipartJeffas
2019-07-17Display user specified headers in viewer if presentDaniel Bridges
2019-07-17Revert "Ensure new partswitcher doesn't start on multipart"Drew DeVault
This reverts commit 41390bc3e1e557eff15e8159767f206b3b74ea30.
2019-07-17Ensure new partswitcher doesn't start on multipartJeffas
2019-07-10Fix crashes when operating on empty folder (#216)Daniel Bridges
2019-07-08Factor IMAP-specific structs out of UI modelsBen Burwell
Before, we were using several IMAP-specific concepts to represent information being displayed in the UI. Factor these structures out of the IMAP package to make it easier for other backends to provide the required information.