From 87765f93de9b5c123be5beee45b62425c71c2005 Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Sun, 16 Apr 2023 09:53:38 -0500 Subject: capabilities: report capabilities from backend Use the Backend interface to report Backend capabilities. Previously, these were reported via a DirectoryInfo message, however they have nothing to do with a directory and should be reported directly by the backend. Add Capabilities method to Backend interface, satisfy this in each backend, and use it on the UI side. Remove Caps field from DirectoryInfo Signed-off-by: Tim Culverhouse Acked-by: Robin Jarry --- worker/imap/checkmail.go | 1 - worker/imap/list.go | 1 - worker/imap/worker.go | 4 ++++ 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'worker/imap') diff --git a/worker/imap/checkmail.go b/worker/imap/checkmail.go index 9c1f14c1..05441a3c 100644 --- a/worker/imap/checkmail.go +++ b/worker/imap/checkmail.go @@ -66,7 +66,6 @@ func (w *IMAPWorker) handleCheckMailMessage(msg *types.CheckMail) { Exists: int(status.Messages), Recent: int(status.Recent), Unseen: int(status.Unseen), - Caps: w.caps, }, Refetch: refetch, }, nil) diff --git a/worker/imap/list.go b/worker/imap/list.go index c7f1ed58..b1bc65a1 100644 --- a/worker/imap/list.go +++ b/worker/imap/list.go @@ -65,7 +65,6 @@ func (imapw *IMAPWorker) handleListDirectories(msg *types.ListDirectories) { Exists: int(status.Messages), Recent: int(status.Recent), Unseen: int(status.Unseen), - Caps: imapw.caps, }, }, nil) } diff --git a/worker/imap/worker.go b/worker/imap/worker.go index 8673c0ff..1f61f458 100644 --- a/worker/imap/worker.go +++ b/worker/imap/worker.go @@ -307,3 +307,7 @@ func (w *IMAPWorker) Run() { } } } + +func (w *IMAPWorker) Capabilities() *models.Capabilities { + return w.caps +} -- cgit