chore: Mark conversations as pending instead of reopen when bot is present (#5751)
With this change, conversations are marked as pending instead of reopening when a bot is connected to that Inbox. Fixes: #5668
This commit is contained in:
@@ -193,7 +193,18 @@ class Message < ApplicationRecord
|
||||
return if conversation.muted?
|
||||
return unless incoming?
|
||||
|
||||
conversation.open! if conversation.resolved? || conversation.snoozed?
|
||||
conversation.open! if conversation.snoozed?
|
||||
|
||||
reopen_resolved_conversation if conversation.resolved?
|
||||
end
|
||||
|
||||
def reopen_resolved_conversation
|
||||
# mark resolved bot conversation as pending to be reopened by bot processor service
|
||||
if conversation.inbox.active_bot?
|
||||
conversation.pending!
|
||||
else
|
||||
conversation.open!
|
||||
end
|
||||
end
|
||||
|
||||
def execute_message_template_hooks
|
||||
|
||||
Reference in New Issue
Block a user