提交 54eb6260 编写于 作者: B Brett Walker

Address review feedback

上级 2e514314
......@@ -11,7 +11,7 @@ module Gitlab
@mail_key = mail_key
end
def can_execute?
def can_handle?
raise NotImplementedError
end
......
......@@ -11,8 +11,9 @@ module Gitlab
class UnsubscribeHandler < BaseHandler
delegate :project, to: :sent_notification, allow_nil: true
HANDLER_REGEX = /\A(?<reply_token>\w+)#{Gitlab::IncomingEmail::UNSUBSCRIBE_SUFFIX}\z/.freeze
HANDLER_REGEX_LEGACY = /\A(?<reply_token>\w+)#{Regexp.escape(Gitlab::IncomingEmail::UNSUBSCRIBE_SUFFIX_LEGACY)}\z/.freeze
HANDLER_REGEX_FOR = -> (suffix) { /\A(?<reply_token>\w+)#{Regexp.escape(suffix)}\z/ }.freeze
HANDLER_REGEX = HANDLER_REGEX_FOR.call(Gitlab::IncomingEmail::UNSUBSCRIBE_SUFFIX).freeze
HANDLER_REGEX_LEGACY = HANDLER_REGEX_FOR.call(Gitlab::IncomingEmail::UNSUBSCRIBE_SUFFIX_LEGACY).freeze
def initialize(mail, mail_key)
super(mail, mail_key)
......@@ -37,8 +38,10 @@ module Gitlab
private
attr_reader :reply_token
def sent_notification
@sent_notification ||= SentNotification.for(@reply_token)
@sent_notification ||= SentNotification.for(reply_token)
end
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册