v2 WIP: imap: reconnect when connection closed v1 PROPOSED

Anjandev Momi: 1
 imap: reconnect when connection closed

 1 files changed, 3 insertions(+), 0 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/aerc/patches/9460/mbox | git am -3
Learn more about email & git

[PATCH v2 WIP] imap: reconnect when connection closed Export this patch

I moved error handling to the imap worker. The patch works but still has the issues 
stated previously by Drew and Reto:

Unfortunately, this is all the time I have right now...If someone wants to
finish, go ahead.
 worker/imap/worker.go | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/worker/imap/worker.go b/worker/imap/worker.go
index 4d3e51c..7040ba7 100644
--- a/worker/imap/worker.go
+++ b/worker/imap/worker.go
@@ -62,6 +62,9 @@ func (w *IMAPWorker) handleMessage(msg types.WorkerMessage) error {
	if w.idleStop != nil {
		if err := <-w.idleDone; err != nil {
			if (err.Error() == "imap: connection closed") {
				w.worker.PostAction(&types.Connect{}, nil)
			w.worker.PostMessage(&types.Error{Error: err}, nil)