summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2017-04-20 11:33:51 +0100
committerSean McGivern <sean@gitlab.com>2017-04-20 12:04:39 +0100
commit4e7ff7c2d44c74d5a10db2c3b015986326c31c8b (patch)
tree51abe9c7680999e34ffd5f68fccd76cbfacdaaa8
parent57edc23385ad82d4428ba34f342aee07cb2d2ba6 (diff)
downloadgitlab-ce-add-email-receiver-metrics.tar.gz
Store projects in metrics for email repliesadd-email-receiver-metrics
-rw-r--r--lib/gitlab/email/handler/create_note_handler.rb6
-rw-r--r--lib/gitlab/email/handler/unsubscribe_handler.rb2
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/gitlab/email/handler/create_note_handler.rb b/lib/gitlab/email/handler/create_note_handler.rb
index 0e22f2189ee..6c779da44fc 100644
--- a/lib/gitlab/email/handler/create_note_handler.rb
+++ b/lib/gitlab/email/handler/create_note_handler.rb
@@ -7,6 +7,8 @@ module Gitlab
class CreateNoteHandler < BaseHandler
include ReplyProcessing
+ delegate :project, to: :sent_notification
+
def can_handle?
mail_key =~ /\A\w+\z/
end
@@ -32,10 +34,6 @@ module Gitlab
sent_notification.recipient
end
- def project
- sent_notification.project
- end
-
def sent_notification
@sent_notification ||= SentNotification.for(mail_key)
end
diff --git a/lib/gitlab/email/handler/unsubscribe_handler.rb b/lib/gitlab/email/handler/unsubscribe_handler.rb
index 97d7a8d65ff..6bce157b88b 100644
--- a/lib/gitlab/email/handler/unsubscribe_handler.rb
+++ b/lib/gitlab/email/handler/unsubscribe_handler.rb
@@ -4,6 +4,8 @@ module Gitlab
module Email
module Handler
class UnsubscribeHandler < BaseHandler
+ delegate :project, to: :sent_notification
+
def can_handle?
mail_key =~ /\A\w+#{Regexp.escape(Gitlab::IncomingEmail::UNSUBSCRIBE_SUFFIX)}\z/
end