Commit Graph

325 Commits

Author SHA1 Message Date
Tim Culverhouse a9af5635bc msgstore: revert 9fdc7acf5b "post messageInfo on erroneous fetch"
Commit 9fdc7acf5b ("cache: fetch flags from UI") introduced a
regression where all messages were marked as erroneous if a single one
in the fetch request had an error.

Reported-by: Jose Lombera <jose@lombera.dev>
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-09-25 11:54:26 +02:00
Koni Marti e5b0725824 charset: handle unknown charsets more user-friendly
Do not throw an error when the charset is unknown; the message entity
can still be read, but log the error instead.

Reported-by: falsifian
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-09-25 11:54:23 +02:00
Tim Culverhouse 9fdc7acf5b cache: fetch flags from UI
When cached headers are fetched, an action is posted back to the Worker
to immediately fetch the flags for the message from the server (we can't
know the flags state, therefore it's not cached). When scrolling, a lag
occurs when loading cached headers because the n+1 message has to wait
for the flag request to return before the cached headers are retrieved.

Collect the message UIDs in the UI that need flags, and fetch them based
off a debounce timer in a single request. Post the action from the UI to
eliminate an (ugly) go routine in the worker.

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-09-20 21:10:35 +02:00
Tim Culverhouse a91009edf7 grid: protect calls to cell.Content
Many panics occur from calling Draw on a nil widget, stemming from the
grid ui element. Protect the calls to Draw from within grid to prevent
this method of panic.

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-09-20 21:07:42 +02:00
Tim Culverhouse a31606db0d grid: remove unused method Children
The grid method Children returns the children of a grid, and is never
used. The function is reimplemented in both aerc.go and account.go, also
never called.

Remove these unused methods.

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-09-20 21:06:08 +02:00
Tim Culverhouse 01f80721e2 msgstore: post MessageInfo on erroneous fetch
When errors occur during a fetch header request, the requested headers
are deleted from pending and no information is given to the UI. Spinners
keep spinning, and ultimately as the view is refreshed, the headers are
fetched again. This can lead to infinite loops, and extremely long logs.

Update the store with a MessageInfo message when an error is received.
Have the UI display that the header couldn't be fetched in the message
list.

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-09-20 00:03:36 +02:00
Bence Ferdinandy 74fd5d1119 statusline-format: add %p placeholder for current path
Allow showing the current working directory in the statusline via
[statusline] render-format=%p, which is useful if the user changes
directories often.

Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com>
Tested-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-09-19 21:25:10 +02:00
Tim Culverhouse cf319129de term: add bracketed paste support
Allow forwarding paste events to embedded applications. When a bracketed
paste is in progress, do not process any command bindings.

Signed-off-by: Robin Jarry <robin@jarry.cc>
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2022-09-14 22:19:42 +02:00
Tim Culverhouse 17c4781911 ui: export context.viewport, screen.show, add SetCursorStyle
Export context.viewport for use in implementing tcell-term.

Bump tcell version to enable SetCursorStyle feature. Add this function
to the ui for future use with tcell-term.

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-09-14 22:12:37 +02:00
Robin Jarry ee7937d0dd ui: cleanup internals and api
Now that tcell events are handled in a goroutine, no need for a channel
to buffer them.

Rename ui.Tick() to ui.Render() and ui.Run() to ui.ProcessEvents() to
better reflect what these functions do.

Move screen.PollEvent() into ui.ProcessEvents(). Register the panic
handler in ui.ProcessEvents().

Remove aerc.ui.Tick() from DecryptKeys(). What the hell was that?

Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Tim Culverhouse <tim@timculverhouse.com>
2022-09-14 22:11:33 +02:00
Moritz Poldrack 37c1db2ab2 socket: use existing socket if it is connected
When using ephemeral aerc sessions – for example while writing patches
for it – the mailto: functionality breaks if the socket is removed.

Try to send a ping (an empty message) to the socket and remove it, if
the send fails or no noop reply is received.

Signed-off-by: Moritz Poldrack <git@moritz.sh>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
2022-09-14 00:03:01 +02:00
Tim Culverhouse c947811e9f ui: process tcell events in a separate go routine from rendering
The UI runs off a 16 ms ticker. If no render is required, and no event
is seen, aerc waits 16 ms before checking for new events or render
requests. This severely limits handling of events from tcell, and is
particularly noticeable on pasting of large quantities of text.

Process tcell events in a separate go routine from the render loop.

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Moritz Poldrack <moritz@poldrack.dev>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-09-13 23:58:54 +02:00
Moritz Poldrack fad90c2956 open-link: make URL parsing more lenient
URLs are extremely loosely defined and can take many shapes which may
not be parsed at all if unusual characters like the exclamation mark are
present. To ensure lists and odd use of spaces are not parsed as links
some sanity-checks are in place:
	- the URL's schema must be at least two characters long
	- the URL's authority, path, and fragment must have a combined
	  length of 8 characters or longer
	- the URL must not contain a whitespace character, >, ), or "
	- the URL may only contain a ] when followed by a different allowed
	  character or at the end of the line (necessary for IPv6
	  authorities)

The tests for this function now include links with an exclamation point
and IPv6 addresses. The tests are given names to be easier identifiable.

Link: https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml
Reported-by: "Bence Ferdinandy" <bence@ferdinandy.com>
Cc: "Koni Marti" <koni.marti@gmail.com>
Fixes: e1d8bc4d17 ("msgviewer: open http links from messages")
Signed-off-by: Moritz Poldrack <git@moritz.sh>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
2022-09-13 23:58:53 +02:00
Tim Culverhouse dcd397f776 pgp: enable quoted replies of encrypted messages
When quoting an encrypted message for reply, the quoted text is shown as
"Version: 1.0". This is due to this being the first non-multipart text
portion of the message, which is what the quoted reply logic looks for.
Properly quote replies to encrypted messages by decrypting the message,
and quoting the content. The message must be open in a message view in
order to quote it (it must be decrypted, which is handled by the message
viewer).

Suggested-by: Moritz Poldrack <moritz@poldrack.dev>
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Tested-by: Jens Grassel <jens@wegtam.com>
2022-08-31 10:10:03 +02:00
Tim Culverhouse cd002567e8 msgstore: do not run threadbuilder unless in threaded view
Commit 380cf13cff ("msgstore: run threadBuilder with no debounce on
DirectoryContents msg") fixed an issue related to running the
threadbuilder with a debounce. This fix causes the thread builder to run
for any DirectoryContents message, even if the view is not threaded.

Don't call runThreadBuilderNow unless in a threaded view.

Fixes: 380cf13cff ("msgstore: run threadBuilder with no debounce on DirectoryContents msg")
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-08-31 10:06:56 +02:00
Tim Culverhouse f530cd96f3 msgstore: enable granularity in updating of threadbuilder
Enable the msgstore to specify if an update should also update the
threadbuilder. Certain calls to msgstore.update() did not require the
threadbuilder to run, as it was either called implicitly through other
means (nextPrev during a search) OR it was not needed (IE in the case of
a DirectoryInfo message).

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-08-30 21:42:37 +02:00
Tim Culverhouse 380cf13cff msgstore: run threadBuilder with no debounce on DirectoryContents msg
Commit 54a0a377e0 ("threads: debounce client-side thread building")
introduced the option to debounce threadbuilding to improve performance
of client side threads. This caused a UI regression during filtering of
mailboxes:

1. The mailbox contains the full set of message UIDs
2. User filters mailbox
3. A DirectoryContents message is received from worker with the proper
   UIDs to display
4. Debounce is started (in a separate go routine)
5. The value of msgStore.Uids() is used to show pending headers, but is
   not updated until the threadbuilder runs. The full set of UIDs is
   shown briefly
6. Debounce is over, threadbuilder runs, updates msgStore.Uids(), proper
   messages show.

Run the thread builder immediately upon receipt of a DirectoryContents
message, bypassing any debounce. Performance will remain the same: the
debounce is meant to prevent multiple sequential calls to the thread
builder during scrolling. This is unlikely to occur in rapid succession
from filtering or sorting.

Fixes: https://todo.sr.ht/~rjarry/aerc/76
Fixes: 54a0a377e0 ("threads: debounce client-side thread building")
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-08-30 21:42:37 +02:00
Tim Culverhouse c98f704874 move: enable MoveMessages from msgstore
Enable the use of MoveMessages worker messages from the UI to the
backend. Completes implemention of MoveMessages for all supported
backends.

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-08-22 15:46:55 +02:00
Koni Marti 588be1a284 store: improve cursor position
Improve cursor re-positioning while filtering with and without threads.
Reposition cursor in client-side threading mode with a callback that is
set during store.NextPrev(). Run callback when the threads are
constructed in order to reposition the cursor correctly. The callback is
deactivated when store.Select() is called.

Steps to reproduce two issues:

* Reproduce issue 1:

1. Activate client-side threading
2. Apply a filter, e.g. :filter -f Koni
3. Move cursor around so that a message is highlighted
4. clear filter with :clear
5. The cursor is expected to remain on the selected message but is
   actually not

* Reproduce issue 2:

1. Activate client-side threading
2. Go the end of the message list
2. Apply a filter, e.g. :filter -f Koni
5. The cursor is now at the end of the filtered results instead of at
   the beginning

This patch fixes both of those issues. Tested in regular and threaded
view according to the following check list (expected behavior in
parenthesis):

1. Apply filter from a message that remains in the filter (cursor on message,
   message selected)
2. Apply filter from a message that will not remain (cursor at the top,
   no message selected)
3. Clear filter (cursor remains on message, message selected)
4. Scroll line-by-line (threads: cursor remains on line, does not "jump"
   with message)
5. Search (cursor on first result)

Signed-off-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Tim Culverhouse <tim@timculverhouse.com>
2022-08-22 10:01:46 +02:00
Koni Marti 117f99e187 mark: (un)mark message threads
Mark or unmark the shown message threads. Threads must be available in the
message store. Use the -T option for the mark or unmark commands. Can be
used in combination with the toggle flag (-t).

Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-08-22 09:30:37 +02:00
Koni Marti b12dd9f926 mark: allow multiple visual selections
When entering visual selection mode, the current selection is deleted.
This patch extends the visual mode behavior to select multiple blocks of
messages.

Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-08-22 09:30:37 +02:00
Koni Marti 16dbb94221 util: fetch message headers for nil messages
Fix large archive operations that covers messages in the store with
unfetched headers. Commit e5ad877af5 ("msgstore: fetch missing headers
in visual mode") fixed this for the visual selection mode but omitted
the case when 'mark -a' is used to mark all messages.

Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-08-22 09:30:37 +02:00
Koni Marti 22e6c9e4fa store: remove unneeded header callback
The message store keeps a map of callbacks for headers that are being
fetched. This is not used anywhere in the code base. Instead of a
func(*types.MessageInfo) callback use a general
func(types.WorkerMessage) in the worker.PostAction function to make it
more useful. This callback allows now to get a feedback when all headers
are fetched successfully. Note that the pending header map remains so
that the same header is not fetched multiple times.

Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-08-22 09:30:37 +02:00
Koni Marti cfc19a7ec2 store: extract marking behavior and add tests
Separate the marking functions from the message store and extract the
marking behavior into its own class with tests.

Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-08-22 09:30:37 +02:00
Moritz Poldrack 9cffc45f03 go: removed io/ioutil
Since the minimum required version of Go has been bumped to 1.16, the
deprecation of io/ioutil can now be acted upon. This Commit removes the
remaining dependencies on ioutil and replaces them with their io or os
counterparts.

Signed-off-by: Moritz Poldrack <git@moritz.sh>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-08-22 09:30:19 +02:00
Tim Culverhouse 6057d156e6 delete: revert deleted messages if Delete is unsupported
Delete operations are not supported by the notmuch backend. Revert
deleted messages when the operation is not supported, and reselect the
original selection.

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Tested-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-08-05 21:57:12 +02:00
Robin Jarry 6b1afc3ae3 tests: fix errors after lint series
Fix the following test failures:

 FAIL: TestMessageInfoHandledError (0.00s)
 parse_test.go:53: could not parse envelope: date parsing failed:
 unrecognized date format:

 FAIL: TestReader (0.07s)
 gpg_test.go:27: using GNUPGHOME = /tmp/TestReader2384941142/001
 reader_test.go:108: Test case: Invalid Signature
 reader_test.go:112: gpg.Read() = gpgmail: failed to read PGP
 message: gpg: failed to run verification: exit status 1

Fixes: 5ca6022d00 ("lint: ensure errors are at least logged (errcheck)")
Fixes: 70bfcfef42 ("lint: work nicely with wrapped errors (errorlint)")
Signed-off-by: Robin Jarry <robin@jarry.cc>
Signed-off-by: Moritz Poldrack <moritz@poldrack.dev>
2022-08-04 22:52:40 +02:00
Moritz Poldrack 70bfcfef42 lint: work nicely with wrapped errors (errorlint)
Error wrapping as introduced in Go 1.13 adds some additional logic to
use for comparing errors and adding information to it.

Signed-off-by: Moritz Poldrack <moritz@poldrack.dev>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-08-04 21:58:04 +02:00
Moritz Poldrack 978d35d356 lint: homogenize operations and minor fixes (gocritic)
Apply GoDoc comment policy (comments for humans should have a space
after the //; machine-readable comments shouldn't)

Use strings.ReplaceAll instead of strings.Replace when appropriate

Remove if/else chains by replacing them with switches

Use short assignment/increment notation

Replace single case switches with if statements

Combine else and if when appropriate

Signed-off-by: Moritz Poldrack <moritz@poldrack.dev>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-08-04 21:58:01 +02:00
Moritz Poldrack c882cf9960 lint: removed unused code (deadcode, structcheck, unused)
Signed-off-by: Moritz Poldrack <moritz@poldrack.dev>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-08-04 21:58:00 +02:00
Moritz Poldrack 5ca6022d00 lint: ensure errors are at least logged (errcheck)
Signed-off-by: Moritz Poldrack <moritz@poldrack.dev>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-08-04 21:57:57 +02:00
Moritz Poldrack ef599aa8fc lint: simplify code (gosimple)
Replaces infinite for loops containing a select on a channel with a
single case with a range over the channel.

Removes redundant assignments to blank identifiers.

Remove unnecessary guard clause around delete().

Remove `if condition { return true } return false` with return condition

Signed-off-by: Moritz Poldrack <moritz@poldrack.dev>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-08-04 21:57:52 +02:00
Moritz Poldrack aaf0a0c656 lint: apply new formatting rules
Run `make fmt`.

Signed-off-by: Moritz Poldrack <git@moritz.sh>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-08-01 10:44:52 +02:00
Koni Marti 5cf81f1cb1 autocompletion: fix regression
Commit 27425c15c4 ("autocompletion: fix slice out of bounds access")
introduced a regression in the autocompletion that messes up the order
of last entered chars when autocompletion runs.

The ranges for a slice a[low:high] are 0 <= low <= high <= len(a) [0]

To reproduce with the ":cf" command:

1) enter ":c"
2) wait for autocompleteion
3) enter "f"
4) the prompt will now be ":fc"

[0]: https://go.dev/ref/spec#Slice_expressions

Fixes: 27425c15c4 ("autocompletion: fix slice out of bounds access")
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-08-01 10:37:49 +02:00
Koni Marti 687c4777b5 store: fix nexprev when filtering
Select the first message with NextPrev when the cursor disappears after
applying a filter where the selected message is not part of. Currently,
the NextPrev would select the last message in the mailbox (like a G
jump).

To reproduce:
1) select a message
2) apply a filter where the selected message is not selected
3) move the cursor and it will jump to the last message

Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-08-01 10:37:47 +02:00
Moritz Poldrack 27425c15c4 autocompletion: fix slice out of bounds access
Signed-off-by: Moritz Poldrack <git@moritz.sh>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-07-31 19:53:13 +02:00
Pinghao Wu b8ef8d2628 index: workaround for wide character printing
This is a workaround for https://todo.sr.ht/~rjarry/aerc/22, by
injecting zero-width spaces in front of wide characters to make up width
calculation in fmt.Sprintf.

With this applied, columns will still be misaligned a little only if
they are left with trailing zero-width spaces when cut. It is better
than a large offset caused by each wide characters in the column.

References: https://todo.sr.ht/~rjarry/aerc/22
Signed-off-by: Pinghao Wu <xdavidwuph@gmail.com>
Acked-by: Koni Marti <koni.marti@gmail.com>
2022-07-30 17:58:26 +02:00
Tim Culverhouse 6db766260b sort: clear sort criteria when called without arguments
Fix a regression introduced by commit c2f4404fca ("threading: enable
filtering of server-side threads"). Prior to this commit, a :sort
command (no args) would clear out the current sort criteria (or rather,
apply the value from the config). Restore this functionality.

Fixes: c2f4404fca ("threading: enable filtering of server-side threads")
Reported-by: akspecs <akspecs@gmail.com>
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-07-26 22:24:01 +02:00
Koni Marti 26b9c3d966 sort: show warning when sort is not supported
Use the capabilities returned by the backend to check whether sort is
implemented when the user tries to use the sort command. Print a warning
to the log when a sort request is silently dropped by the backend.

Suggested-by: |cos|
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-07-26 22:22:58 +02:00
Koni Marti cfbb548fb8 threads: match regular view scrolling behavior
Try to keep the position in the message list when scrolling through
threaded messages to match the scrolling behavior of the regular view.
This only needs to be implemented for the client-side threading since we
have to rebuild the threads when new messages arrive.

Reported-by: akspecs <akspecs@gmail.com>
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Akspecs <akspecs@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-07-26 22:22:56 +02:00
Koni Marti 866867c616 threads: fix race warnings for client-side debouncing
Client-side thread debouncing happens in a different goroutine. Any
function or variable that is called or accessed by this goroutine should
be protected from a concurrent access.

Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-07-26 22:22:53 +02:00
Koni Marti 54a0a377e0 threads: debounce client-side thread building
Debounce client-side thread building in the message store. Debouncing is
useful when multiple messages are loaded, i.e. when scrolling with
PgUp/PgDown.

Without the debouncing, all client-side threads will be built everytime
the message store is updated which creates a noticable lag in the
message list ui when client-side threading is activated.

The default debouncing delay can be changed by changing
'client-threads-delay' in the UI config section.

Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-07-26 22:22:48 +02:00
Koni Marti 8f7695fde5 msgstore: implement a uid-based architecture
Change the message store architecture from an index-based to a uid-based
one. Key advantage of this design approach is that no reselect mechanism
is required anymore since it comes with the design for free.

Fixes: https://todo.sr.ht/~rjarry/aerc/43
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Tested-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-07-26 11:34:19 +02:00
akspecs 0f86666f52 msgstore: check if message index < 0, select 0 if so
Calling :prev without this check can cause the index to go below 0 if
the current index is smaller than the value being scrolled / incremented
by. This results in the email selector wrapping around from the top to
the bottom most email in the mailbox folder due to changes in ec150f0
'store: fix Select behaviour'.

Signed-off-by: akspecs <akspecs@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-07-24 23:05:07 +02:00
Tim Culverhouse 4036f696ad msgstore: refactor NextPrev
Refactor NextPrev to use already existing selection methods and bounds
checking

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-07-24 23:05:00 +02:00
Tim Culverhouse f8e6478d46 store: fix Select behavior
Fix the behavior of the Select(index int) method to select the last
message if an index > len(list) or select from bottom of list for
negative indexes.

Thanks: akspecs <akspecs@gmail.com>
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-07-24 23:04:52 +02:00
Robin Jarry cd19995557 logging: use level-based logger functions
Do not pass logger objects around anymore. Shuffle some messages to make
them consistent with the new logging API. Avoid using %v when a more
specific verb exists for the argument types.

The loggers are completely disabled (i.e. Sprintf is not even called)
by default. They are only enabled when redirecting stdout to a file.

Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Moritz Poldrack <moritz@poldrack.dev>
2022-07-23 22:52:15 +02:00
Robin Jarry 050d54a822 tabs: make it more thread safe
Protect the access to the tabs array and current index with a mutex.

Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Koni Marti <koni.marti@gmail.com>
2022-07-23 22:00:29 +02:00
Robin Jarry 171fefd209 tabs: make fields private
The Tabs object exposes an array of Tab objects and the current selected
index in that array. The these two fields are sometimes modified in
goroutines, which can lead to data races causing fatal out of bounds
accesses on the tab array.

Hide these fields as private API. Expose only what needs to be seen from
the outside. This will prepare for protecting concurrent access with
a lock in the next commit.

Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Koni Marti <koni.marti@gmail.com>
2022-07-23 22:00:25 +02:00
Robin Jarry 52f7d3f900 gpg: set a name for the attached pgp signature part
This makes it more explicit for non pgp compatible clients. Without
this, they may show "unnamed part" or "noname".

Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Moritz Poldrack <moritz@poldrack.dev>
2022-07-18 21:12:46 +02:00