Browse Source

Ignore auto reply.

Martin Edenhofer 8 years ago
parent
commit
59b115669a
1 changed files with 7 additions and 0 deletions
  1. 7 0
      app/models/transaction/slack.rb

+ 7 - 0
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