FIX: IMAP archive fix and group list mailbox code unification (#10355)

* Fixed an issue I introduced in the last PR where I am just archiving everything regardless of whether it is actually archived in Discourse man_facepalming
* Refactor group list_mailboxes IMAP code to use providers, add specs, and add provider code to get the correct prodivder
This commit is contained in:
Martin Brennan
2020-08-04 14:19:57 +10:00
committed by GitHub
parent c937afc75e
commit 5a3494b1e1
10 changed files with 320 additions and 36 deletions

View File

@@ -25,7 +25,7 @@ class Demon::EmailSync < ::Demon::Base
RailsMultisite::ConnectionManagement.with_connection(db) do
puts "[EmailSync] Thread started for group #{group.name} (id = #{group.id}) in db #{db}"
begin
obj = Imap::Sync.for_group(group)
obj = Imap::Sync.new(group)
rescue Net::IMAP::NoResponseError => e
group.update(imap_last_error: e.message)
Thread.exit