2016-05-21 12:40:08 -04:00
|
|
|
require 'gitlab/email/handler/create_note_handler'
|
|
|
|
require 'gitlab/email/handler/create_issue_handler'
|
|
|
|
|
2016-05-18 18:19:25 -04:00
|
|
|
module Gitlab
|
|
|
|
module Email
|
2016-05-21 12:40:08 -04:00
|
|
|
module Handler
|
2016-08-19 20:07:02 -04:00
|
|
|
# The `CreateIssueHandler` feature is disabled for the time being.
|
|
|
|
HANDLERS = [CreateNoteHandler]
|
2016-06-15 04:31:28 -04:00
|
|
|
|
2016-05-21 12:40:08 -04:00
|
|
|
def self.for(mail, mail_key)
|
2016-06-15 04:31:28 -04:00
|
|
|
HANDLERS.find do |klass|
|
2016-05-21 12:40:08 -04:00
|
|
|
handler = klass.new(mail, mail_key)
|
|
|
|
break handler if handler.can_handle?
|
|
|
|
end
|
2016-05-18 18:19:25 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|