Automation enhancement (#4087)

This commit is contained in:
Tejaswini Chile
2022-03-21 13:12:27 +05:30
committed by GitHub
parent c608ca37e0
commit e06a6a7c55
17 changed files with 275 additions and 60 deletions

View File

@@ -166,6 +166,8 @@ class Message < ApplicationRecord
end
def dispatch_create_events
return if Current.executed_by.present? && Current.executed_by.instance_of?(AutomationRule)
Rails.configuration.dispatcher.dispatch(MESSAGE_CREATED, Time.zone.now, message: self)
if outgoing? && conversation.messages.outgoing.count == 1
@@ -174,6 +176,8 @@ class Message < ApplicationRecord
end
def dispatch_update_event
return if Current.executed_by.present? && Current.executed_by.instance_of?(AutomationRule)
Rails.configuration.dispatcher.dispatch(MESSAGE_UPDATED, Time.zone.now, message: self)
end