Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
54eb6260
Commit
54eb6260
authored
Dec 20, 2018
by
Brett Walker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address review feedback
parent
2e514314
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
lib/gitlab/email/handler/base_handler.rb
lib/gitlab/email/handler/base_handler.rb
+1
-1
lib/gitlab/email/handler/unsubscribe_handler.rb
lib/gitlab/email/handler/unsubscribe_handler.rb
+6
-3
No files found.
lib/gitlab/email/handler/base_handler.rb
View file @
54eb6260
...
...
@@ -11,7 +11,7 @@ module Gitlab
@mail_key
=
mail_key
end
def
can_
execut
e?
def
can_
handl
e?
raise
NotImplementedError
end
...
...
lib/gitlab/email/handler/unsubscribe_handler.rb
View file @
54eb6260
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment