fix: Move the check for CaptainAssistant to enterprise (#11500)

This commit is contained in:
Sojan Jose
2025-05-16 16:59:43 -07:00
committed by GitHub
parent 6dc73841f2
commit 84dae4e4a9
2 changed files with 11 additions and 2 deletions

View File

@@ -80,8 +80,6 @@ module ActivityMessageHandler
def automation_status_change_activity_content def automation_status_change_activity_content
if Current.executed_by.instance_of?(AutomationRule) if Current.executed_by.instance_of?(AutomationRule)
I18n.t("conversations.activity.status.#{status}", user_name: I18n.t('automation.system_name')) I18n.t("conversations.activity.status.#{status}", user_name: I18n.t('automation.system_name'))
elsif Current.executed_by.instance_of?(Captain::Assistant) && resolved?
I18n.t('conversations.activity.captain.resolved', user_name: Current.executed_by.name)
elsif Current.executed_by.instance_of?(Contact) elsif Current.executed_by.instance_of?(Contact)
Current.executed_by = nil Current.executed_by = nil
I18n.t('conversations.activity.status.system_auto_open') I18n.t('conversations.activity.status.system_auto_open')
@@ -128,3 +126,5 @@ module ActivityMessageHandler
user_name user_name
end end
end end
ActivityMessageHandler.prepend_mod_with('ActivityMessageHandler')

View File

@@ -0,0 +1,9 @@
module Enterprise::ActivityMessageHandler
def automation_status_change_activity_content
if Current.executed_by.instance_of?(Captain::Assistant) && resolved?
I18n.t('conversations.activity.captain.resolved', user_name: Current.executed_by.name)
else
super
end
end
end