fix: captain talking over support agent (#13673)
This commit is contained in:
@@ -310,6 +310,7 @@ class Message < ApplicationRecord
|
||||
def execute_after_create_commit_callbacks
|
||||
# rails issue with order of active record callbacks being executed https://github.com/rails/rails/issues/20911
|
||||
reopen_conversation
|
||||
mark_pending_conversation_as_open_for_human_response
|
||||
set_conversation_activity
|
||||
dispatch_create_events
|
||||
send_reply
|
||||
@@ -390,6 +391,18 @@ class Message < ApplicationRecord
|
||||
reopen_resolved_conversation if conversation.resolved?
|
||||
end
|
||||
|
||||
def mark_pending_conversation_as_open_for_human_response
|
||||
return unless captain_pending_conversation?
|
||||
return unless human_response?
|
||||
return if private?
|
||||
|
||||
conversation.open!
|
||||
end
|
||||
|
||||
def captain_pending_conversation?
|
||||
false
|
||||
end
|
||||
|
||||
def reopen_resolved_conversation
|
||||
# mark resolved bot conversation as pending to be reopened by bot processor service
|
||||
if conversation.inbox.active_bot?
|
||||
|
||||
Reference in New Issue
Block a user