Reduced complexity (not needed code).

This commit is contained in:
Martin Edenhofer 2016-08-23 08:35:23 +02:00
parent e4a731dcad
commit 42b45e50c1

View file

@ -8,19 +8,15 @@ module Channel::Filter::IdentifySender
customer_user = nil customer_user = nil
if !customer_user_id.empty? if !customer_user_id.empty?
customer_user = User.lookup(id: customer_user_id) customer_user = User.lookup(id: customer_user_id)
if !customer_user if customer_user
Rails.logger.debug "Invalid x-zammad-customer-id header '#{customer_user_id}', no such user."
else
Rails.logger.debug "Took customer form x-zammad-customer-id header '#{customer_user_id}'." Rails.logger.debug "Took customer form x-zammad-customer-id header '#{customer_user_id}'."
if customer_user else
create_recipients(mail) Rails.logger.debug "Invalid x-zammad-customer-id header '#{customer_user_id}', no such user."
return
end
end end
end end
# check if sender exists in database # check if sender exists in database
if !mail[ 'x-zammad-customer-login'.to_sym ].empty? if !customer_user && !mail[ 'x-zammad-customer-login'.to_sym ].empty?
customer_user = User.find_by(login: mail[ 'x-zammad-customer-login'.to_sym ]) customer_user = User.find_by(login: mail[ 'x-zammad-customer-login'.to_sym ])
end end
if !customer_user && !mail[ 'x-zammad-customer-email'.to_sym ].empty? if !customer_user && !mail[ 'x-zammad-customer-email'.to_sym ].empty?