From 59b115669a973793171c8f767774368354f6f777 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 16 May 2016 17:01:59 +0200 Subject: [PATCH] Ignore auto reply. --- app/models/transaction/slack.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/models/transaction/slack.rb b/app/models/transaction/slack.rb index 6c12f4900..a9821928e 100644 --- a/app/models/transaction/slack.rb +++ b/app/models/transaction/slack.rb @@ -43,6 +43,13 @@ backend.perform ticket = Ticket.find(@item[:object_id]) if @item[:article_id] article = Ticket::Article.find(@item[:article_id]) + + # ignore notifications + sender = Ticket::Article::Sender.lookup(id: article.sender_id) + if sender && sender.name == 'System' + return if @item[:changes].empty? + article = nil + end end # ignore if no changes has been done