mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 11:41:03 +08:00
Make rubocop happy again.
This commit is contained in:
@ -119,30 +119,30 @@ class WebhooksController < ActionController::Base
|
||||
|
||||
private
|
||||
|
||||
def mailgun_failure
|
||||
render body: nil, status: 406
|
||||
end
|
||||
def mailgun_failure
|
||||
render body: nil, status: 406
|
||||
end
|
||||
|
||||
def mailgun_success
|
||||
render body: nil, status: 200
|
||||
end
|
||||
def mailgun_success
|
||||
render body: nil, status: 200
|
||||
end
|
||||
|
||||
def mailgun_verify(timestamp, token, signature)
|
||||
digest = OpenSSL::Digest::SHA256.new
|
||||
data = "#{timestamp}#{token}"
|
||||
signature == OpenSSL::HMAC.hexdigest(digest, SiteSetting.mailgun_api_key, data)
|
||||
end
|
||||
def mailgun_verify(timestamp, token, signature)
|
||||
digest = OpenSSL::Digest::SHA256.new
|
||||
data = "#{timestamp}#{token}"
|
||||
signature == OpenSSL::HMAC.hexdigest(digest, SiteSetting.mailgun_api_key, data)
|
||||
end
|
||||
|
||||
def process_bounce(message_id, to_address, bounce_score)
|
||||
return if message_id.blank? || to_address.blank?
|
||||
def process_bounce(message_id, to_address, bounce_score)
|
||||
return if message_id.blank? || to_address.blank?
|
||||
|
||||
email_log = EmailLog.find_by(message_id: message_id, to_address: to_address)
|
||||
return if email_log.nil?
|
||||
email_log = EmailLog.find_by(message_id: message_id, to_address: to_address)
|
||||
return if email_log.nil?
|
||||
|
||||
email_log.update_columns(bounced: true)
|
||||
return if email_log.user.nil? || email_log.user.email.blank?
|
||||
email_log.update_columns(bounced: true)
|
||||
return if email_log.user.nil? || email_log.user.email.blank?
|
||||
|
||||
Email::Receiver.update_bounce_score(email_log.user.email, bounce_score)
|
||||
end
|
||||
Email::Receiver.update_bounce_score(email_log.user.email, bounce_score)
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user