diff options
Diffstat (limited to 'worker')
-rw-r--r-- | worker/imap/open.go | 17 | ||||
-rw-r--r-- | worker/imap/worker.go | 2 | ||||
-rw-r--r-- | worker/types/messages.go | 9 |
3 files changed, 28 insertions, 0 deletions
diff --git a/worker/imap/open.go b/worker/imap/open.go index 1152887..c7a479a 100644 --- a/worker/imap/open.go +++ b/worker/imap/open.go @@ -50,6 +50,23 @@ func (imapw *IMAPWorker) handleFetchDirectoryContents( } } +func (imapw *IMAPWorker) handleNativeThreadSupport( + msg *types.FetchNativeThreadSupport) { + hasSupport, err := imapw.client.tc.SupportThread() + if err != nil { + imapw.worker.PostMessage(&types.Error{ + Message: types.RespondTo(msg), + Error: err, + }, nil) + } else { + imapw.worker.PostMessage(&types.NativeThreadSupport{ + Message: types.RespondTo(msg), + HasSupport: hasSupport, + }, nil) + imapw.worker.PostMessage(&types.Done{types.RespondTo(msg)}, nil) + } +} + func (imapw *IMAPWorker) handleDirectoryThreaded( msg *types.FetchDirectoryThreaded) { imapw.worker.Logger.Printf("Fetching threaded UID list") diff --git a/worker/imap/worker.go b/worker/imap/worker.go index 1ba3774..ed1ad9e 100644 --- a/worker/imap/worker.go +++ b/worker/imap/worker.go @@ -165,6 +165,8 @@ func (w *IMAPWorker) handleMessage(msg types.WorkerMessage) error { w.handleFetchDirectoryContents(msg) case *types.FetchDirectoryThreaded: w.handleDirectoryThreaded(msg) + case *types.FetchNativeThreadSupport: + w.handleNativeThreadSupport(msg) case *types.CreateDirectory: w.handleCreateDirectory(msg) case *types.FetchMessageHeaders: diff --git a/worker/types/messages.go b/worker/types/messages.go index d5f2484..2cde38f 100644 --- a/worker/types/messages.go +++ b/worker/types/messages.go @@ -81,6 +81,10 @@ type FetchDirectoryContents struct { SortCriteria []*SortCriterion } +type FetchNativeThreadSupport struct { + Message +} + type FetchDirectoryThreaded struct { Message SortCriteria []*SortCriterion @@ -157,6 +161,11 @@ type DirectoryContents struct { Uids []uint32 } +type NativeThreadSupport struct { + Message + HasSupport bool +} + type DirectoryThreaded struct { Message ThreadRoot *Thread |