diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-09-21 10:46:47 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-09-21 11:35:37 +0300 |
commit | ee028d9d60522f8993a0b2429ac8a0631d59229a (patch) | |
tree | 5e028593ff4394df287de8f61824c8d004a81688 /app | |
parent | 11bbc06b4bbcb678f3ee6b8f1d143ed86d25a76c (diff) |
Rename reply_by_email to incoming_email to prepare for the future.
Diffstat (limited to 'app')
-rw-r--r-- | app/mailers/notify.rb | 4 | ||||
-rw-r--r-- | app/models/sent_notification.rb | 6 | ||||
-rw-r--r-- | app/views/admin/dashboard/index.html.haml | 2 | ||||
-rw-r--r-- | app/workers/email_receiver_worker.rb | 2 |
4 files changed, 10 insertions, 4 deletions
diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb index f196ffd53f3..db2f9654e14 100644 --- a/app/mailers/notify.rb +++ b/app/mailers/notify.rb @@ -110,7 +110,7 @@ class Notify < BaseMailer if reply_key headers['X-GitLab-Reply-Key'] = reply_key - address = Mail::Address.new(Gitlab::ReplyByEmail.reply_address(reply_key)) + address = Mail::Address.new(Gitlab::IncomingEmail.reply_address(reply_key)) address.display_name = @project.name_with_namespace headers['Reply-To'] = address @@ -150,6 +150,6 @@ class Notify < BaseMailer end def reply_key - @reply_key ||= Gitlab::ReplyByEmail.reply_key + @reply_key ||= SentNotification.reply_key end end diff --git a/app/models/sent_notification.rb b/app/models/sent_notification.rb index 33b113a2a27..2724af8e613 100644 --- a/app/models/sent_notification.rb +++ b/app/models/sent_notification.rb @@ -23,6 +23,12 @@ class SentNotification < ActiveRecord::Base validates :commit_id, presence: true, if: :for_commit? class << self + def reply_key + return nil unless Gitlab::IncomingEmail.enabled? + + SecureRandom.hex(16) + end + def for(reply_key) find_by(reply_key: reply_key) end diff --git a/app/views/admin/dashboard/index.html.haml b/app/views/admin/dashboard/index.html.haml index 54191aadda6..8657d2c71fe 100644 --- a/app/views/admin/dashboard/index.html.haml +++ b/app/views/admin/dashboard/index.html.haml @@ -58,7 +58,7 @@ %p Reply by email %span.light.pull-right - = boolean_to_icon Gitlab::ReplyByEmail.enabled? + = boolean_to_icon Gitlab::IncomingEmail.enabled? .col-md-4 %h4 Components diff --git a/app/workers/email_receiver_worker.rb b/app/workers/email_receiver_worker.rb index 8cfb96ef376..5a921a73fe9 100644 --- a/app/workers/email_receiver_worker.rb +++ b/app/workers/email_receiver_worker.rb @@ -4,7 +4,7 @@ class EmailReceiverWorker sidekiq_options queue: :incoming_email def perform(raw) - return unless Gitlab::ReplyByEmail.enabled? + return unless Gitlab::IncomingEmail.enabled? begin Gitlab::Email::Receiver.new(raw).execute |