Commit Graph

17 Commits

Author SHA1 Message Date
Tim Culverhouse bb1249164d aerc: use single event loop
Combine tcell events with WorkerMessages to better synchronize state
with IO and UI. Remove Tick loop for rendering. Use events to trigger
renders.

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
2022-10-07 10:51:53 +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 0d645bcebd go.mod: change base git url
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>
2021-11-05 10:21:45 +01:00
Reto Brunner 6fed04bb9f Register worker in init.
This allows backends which can't always be compiled due to missing
dependencies (say libnotmuch) to be compiled conditionally with buildflags.
2019-07-19 15:37:55 -04:00
Ben Burwell 6473848d87 maildir: Watch for new messages
When a directory is opened, start watching its "new" subdirectory for
incoming messages using the fsnotify library. When creation events are
detected, run the Unseen routine to move the message from new to cur and
add new UIDs to the store, updating the UI's list of directory contents
as we go.
2019-07-17 17:29:11 -04:00
Ben Burwell 1b8b6e218c Add maildir backend worker
Add the initial implementation of a backend for Maildir accounts. Much
of the functionality required is implemented in the go-message and
go-maildir libraries, so we use them as much as possible.

The maildir worker hooks into a new maildir:// URL scheme in the
accounts.conf file which points to a container of several maildir
directories. From there, the OpenDirectory, FetchDirectoryContents, etc
messages work on subdirectories. This is implemented as a Container
struct which handles mapping between the symbolic email folder names and
UIDs to the concrete directories and file names.
2019-07-12 11:09:50 -04:00
Drew DeVault 2dc436555d Load IMAP worker for imap+insecure 2019-05-20 19:28:04 -04:00
Drew DeVault 98da4c9509 s/aerc2/aerc/g 2019-05-17 20:57:10 -04:00
Simon Ser 9ef2a57b51 worker/types: fix Worker.Callbacks race condition
Worker.Process* functions were called in different goroutines than
Worker.Post*. Protect the map with a mutex. Also make the map unexported to
prevent external unprotected accesses.

Worker.Process* functions used to delete items from the map. However they
didn't delete the element they retrieved: callbacks[msg.InResponseTo()] was
read while callbacks[msg] was deleted. I'm not sure I understand why. I tried
to delete the element that was accessed - but this broke everything (UI froze
at "Connecting..."). I don't believe any elements were actually removed from
the map, so the new code just doesn't remove anything.
2019-04-27 14:28:26 -04:00
Drew DeVault 1265d9cff8 Apply gofmt 2018-06-12 09:50:46 -04:00
Markus Ongyerth 67d14977fa fallthrough in worker selection 2018-06-12 09:49:38 -04:00
Drew DeVault d24e4712a4 Reduce boilerplate in worker/UI 2018-02-01 18:42:03 -05:00
Drew DeVault a21afdaa6b Improve logging 2018-01-31 21:18:21 -05:00
Drew DeVault 4074445cbb Move worker into account tab 2018-01-11 09:04:18 -05:00
emersion a0be5e8025 Misc idiomatic fixes 2018-01-10 11:20:41 -05:00
Drew DeVault b5d5e0dbed Parse account configuration 2018-01-09 21:31:36 -05:00
Drew DeVault 6394e386c2 Initial pass on worker/UI message passing 2018-01-09 20:39:00 -05:00