discourse/lib/imap/providers/detector.rb
Martin Brennan 5a3494b1e1
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
2020-08-04 14:19:57 +10:00

15 lines
350 B
Ruby

# frozen_string_literal: true
module Imap
module Providers
class Detector
def self.init_with_detected_provider(config)
if config[:server] == 'imap.gmail.com'
return Imap::Providers::Gmail.new(config[:server], config)
end
Imap::Providers::Generic.new(config[:server], config)
end
end
end
end