Fixed rubocops.
This commit is contained in:
parent
780fac2bbb
commit
2394a89e46
2 changed files with 14 additions and 17 deletions
|
@ -17,11 +17,10 @@ module Channel::Filter::BounceCheck
|
||||||
next if !result[:message_id]
|
next if !result[:message_id]
|
||||||
message_id_md5 = Digest::MD5.hexdigest(result[:message_id])
|
message_id_md5 = Digest::MD5.hexdigest(result[:message_id])
|
||||||
article = Ticket::Article.where(message_id_md5: message_id_md5).order('created_at DESC, id DESC').limit(1).first
|
article = Ticket::Article.where(message_id_md5: message_id_md5).order('created_at DESC, id DESC').limit(1).first
|
||||||
if article
|
next if !article
|
||||||
Rails.logger.debug "Follow up for '##{article.ticket.number}' in bounce email."
|
Rails.logger.debug "Follow up for '##{article.ticket.number}' in bounce email."
|
||||||
mail[ 'x-zammad-ticket-id'.to_sym ] = article.ticket_id
|
mail[ 'x-zammad-ticket-id'.to_sym ] = article.ticket_id
|
||||||
return true
|
return true
|
||||||
end
|
|
||||||
}
|
}
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -31,11 +31,10 @@ module Channel::Filter::FollowUpCheck
|
||||||
mail[:attachments].each {|attachment|
|
mail[:attachments].each {|attachment|
|
||||||
next if !attachment[:data]
|
next if !attachment[:data]
|
||||||
ticket = Ticket::Number.check(attachment[:data])
|
ticket = Ticket::Number.check(attachment[:data])
|
||||||
if ticket
|
next if !ticket
|
||||||
Rails.logger.debug "Follow up for '##{ticket.number}' in attachment."
|
Rails.logger.debug "Follow up for '##{ticket.number}' in attachment."
|
||||||
mail[ 'x-zammad-ticket-id'.to_sym ] = ticket.id
|
mail[ 'x-zammad-ticket-id'.to_sym ] = ticket.id
|
||||||
return true
|
return true
|
||||||
end
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -55,16 +54,15 @@ module Channel::Filter::FollowUpCheck
|
||||||
end
|
end
|
||||||
if references != ''
|
if references != ''
|
||||||
message_ids = references.split(/\s+/)
|
message_ids = references.split(/\s+/)
|
||||||
sender_type_agent = Ticket::Article::Sender.lookup(name:'Agent')
|
sender_type_agent = Ticket::Article::Sender.lookup(name: 'Agent')
|
||||||
sender_type_system = Ticket::Article::Sender.lookup(name:'System')
|
sender_type_system = Ticket::Article::Sender.lookup(name: 'System')
|
||||||
message_ids.each {|message_id|
|
message_ids.each {|message_id|
|
||||||
message_id_md5 = Digest::MD5.hexdigest(message_id)
|
message_id_md5 = Digest::MD5.hexdigest(message_id)
|
||||||
article = Ticket::Article.where(message_id_md5: message_id_md5, sender_id: [sender_type_agent.id, sender_type_system.id]).order('created_at DESC, id DESC').limit(1).first
|
article = Ticket::Article.where(message_id_md5: message_id_md5, sender_id: [sender_type_agent.id, sender_type_system.id]).order('created_at DESC, id DESC').limit(1).first
|
||||||
if article
|
next if !article
|
||||||
Rails.logger.debug "Follow up for '##{article.ticket.number}' in references."
|
Rails.logger.debug "Follow up for '##{article.ticket.number}' in references."
|
||||||
mail[ 'x-zammad-ticket-id'.to_sym ] = article.ticket_id
|
mail[ 'x-zammad-ticket-id'.to_sym ] = article.ticket_id
|
||||||
return true
|
return true
|
||||||
end
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue