summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2015-09-21 18:52:13 +0000
committerRobert Speicher <robert@gitlab.com>2015-09-21 18:52:13 +0000
commitd4a960161eecf5730b56d3f375573fa39aa67e95 (patch)
tree543dacf2fb1a37e77c4ae91cf935015e2d9f410f /app
parent534e548d4495e2193af6542ca8d62e7d5a3a223b (diff)
parent017219e7f548936ce348eeb445dc4717896902ec (diff)
downloadgitlab-ce-d4a960161eecf5730b56d3f375573fa39aa67e95.tar.gz
Merge branch 'rename-reply-by-email' into 'master'
Rename reply_by_email to incoming_email to prepare for the future. Closes #2579. See merge request !1367
Diffstat (limited to 'app')
-rw-r--r--app/mailers/notify.rb4
-rw-r--r--app/models/sent_notification.rb6
-rw-r--r--app/views/admin/dashboard/index.html.haml2
-rw-r--r--app/workers/email_receiver_worker.rb2
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 03425389dd3..3eed5c16e45 100644
--- a/app/models/sent_notification.rb
+++ b/app/models/sent_notification.rb
@@ -25,6 +25,12 @@ class SentNotification < ActiveRecord::Base
validates :line_code, format: { with: /\A[a-z0-9]+_\d+_\d+\Z/ }, allow_blank: true
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