Commit Graph

82 Commits

Author SHA1 Message Date
Drew DeVault 363aab5cc1 Make :pipe command more generic 2019-07-05 12:21:12 -04:00
Clayton Craft dd178262bb Select user's preferred mimetype in MessageViewer
This implements selecting the most preferred mimetype under the
'View->Alternatives' configuration setting when viewing a message.
Mimetypes in the alternatives array are weighted by their position,
where the lower the index in the array the higher the priority, so this
is taken into account during selection.

If no message part matches a mimetype in the alternatives array, then it
selects the first mimetype in the message.
2019-06-09 11:49:11 -04:00
Yash Srivastav fca7321639 Message list: implement index-format option 2019-06-07 16:22:01 -04:00
Drew DeVault 0647ea6483 Move ANSI stripping from filters to Go 2019-06-07 11:14:50 -04:00
Drew DeVault 668f7f9e5d Remove unnecessary branch 2019-06-07 10:19:29 -04:00
Yash Srivastav b83e7c9fa6 implements ability to view headers in message view 2019-06-07 09:20:24 -04:00
Drew DeVault 7d1770754f Add date to message viewer 2019-06-02 10:23:53 -04:00
Kevin Kuehler 753adb9069 widget: Add ProvidesMessage interface
Consists of 3 functions
* Store: Access to MessageStore type
* SelectedAccount: Access to Account widget that the target widget
belongs to
* SelectedMessage: Current message (selected in msglist or the one we
are viewing)

Signed-off-by: Kevin Kuehler <keur@ocf.berkeley.edu>
2019-06-02 10:16:29 -04:00
Drew DeVault 7f434850b5 Simplify layout of message viewer grid
This sub-grid was an artifact of an older design
2019-06-02 09:33:41 -04:00
Galen Abell 28fc9fa53d Add :save and :pipe commands to viewer
* :save takes a path and saves the current message part to that location
* :pipe is the same as pipe on the account page, but uses the current
  message part rather than the whole email (ie :pipe gzip -d)
* Refactored account:pipe and extracted common pipe code to
  commands.util.QuickTerm
* Added helper command aerc.PushError
2019-05-27 09:37:07 -04:00
Drew DeVault 3cf6c82633 msgviewer: copy stderr into pager
This prevents a broken filter config from being a silent error
2019-05-26 11:18:51 -04:00
Drew DeVault 33f2d4f9ee Show unsupported mimetype message in red 2019-05-20 17:05:37 -04:00
Drew DeVault d224487b68 Show attachment names in multipart view 2019-05-20 17:03:37 -04:00
Drew DeVault 0897413a3e Implement :next-part, :prev-part 2019-05-20 16:49:39 -04:00
Drew DeVault 511fea3944 Flesh out multipart switcher 2019-05-20 16:43:08 -04:00
Drew DeVault 3376f926ed Refactor message part into dedicated widget 2019-05-20 15:03:47 -04:00
Drew DeVault 98da4c9509 s/aerc2/aerc/g 2019-05-17 20:57:10 -04:00
Drew DeVault 6c36e04c1f Add :send-message, prepares & writes email to /tmp 2019-05-14 13:07:48 -04:00
Simon Ser 5685a17674 lib/ui: introduce Invalidatable
Many Drawable implementations have their own Invalidate and OnInvalidate
functions, with an unexported onInvalidate field. However OnInvalidate and
Invalidate are usually not called in the same goroutine. This results in a race
on this field, e.g.:

    Read at 0x00c000094748 by goroutine 7:
      git.sr.ht/~sircmpwn/aerc2/widgets.NewDirectoryList.func1()
          /home/simon/src/aerc2/widgets/dirlist.go:85 +0x56
      git.sr.ht/~sircmpwn/aerc2/widgets.(*Spinner).Start.func1()
          /home/simon/src/aerc2/widgets/spinner.go:93 +0x1bb

    Previous write at 0x00c000094748 by main goroutine:
      [failed to restore the stack]

    Goroutine 7 (running) created at:
      git.sr.ht/~sircmpwn/aerc2/widgets.(*Spinner).Start()
          /home/simon/src/aerc2/widgets/spinner.go:46 +0x8f
      git.sr.ht/~sircmpwn/aerc2/widgets.NewDirectoryList()
          /home/simon/src/aerc2/widgets/dirlist.go:37 +0x286
      git.sr.ht/~sircmpwn/aerc2/widgets.NewAccountView()
          /home/simon/src/aerc2/widgets/account.go:50 +0x5ca
      git.sr.ht/~sircmpwn/aerc2/widgets.NewAerc()
          /home/simon/src/aerc2/widgets/aerc.go:60 +0x800
      main.main()
          /home/simon/src/aerc2/aerc.go:65 +0x33e

To fix this, introduce a new type, Invalidatable, which protects the field.
Unfortunately the Drawable must be passed to the callback function in
Invalidate, so we still need to re-implement this in each Invalidatable user.
2019-04-27 14:30:28 -04:00
Gokberk Yaltirakli ec09ec8b0e Lowercase MIME types while matching filters 2019-04-07 14:12:19 -04:00
Drew DeVault 315cdf308a Remove extra debug statement 2019-03-31 15:21:33 -04:00
Drew DeVault 36419d85aa Use shell to execute filters, fix non-determinism 2019-03-31 15:21:04 -04:00
Drew DeVault 8e5ed2a161 Implement header-regex-match filters 2019-03-31 14:42:18 -04:00
Drew DeVault f9262e4b06 Improve error handling in message viewer
Still not great but at least it tells you when something went wrong
2019-03-31 14:32:26 -04:00
Drew DeVault bbdf9df75e Add basic filter implementation 2019-03-31 14:24:53 -04:00
Drew DeVault 711d22891b Decode messages before rendering them 2019-03-31 13:36:37 -04:00
Drew DeVault 0abafa60e1 Make message viewer real, part two 2019-03-31 12:35:51 -04:00
Drew DeVault 27b25174e2 Make the message viewer real, part one 2019-03-31 12:14:37 -04:00
Drew DeVault 4bdc0f3715 Minor refactoring to header view 2019-03-30 16:50:14 -04:00
Drew DeVault 78db7ccafa Use bold instead of inverted for header names 2019-03-30 15:59:42 -04:00
Drew DeVault 337dd18c9c Add multipart selector mockup to msgviewer 2019-03-30 15:55:21 -04:00
Drew DeVault fa04a1e036 Add basic message viewer mockup 2019-03-30 14:12:04 -04:00