chore: Improve the behaviour of lock to single conversation (#7863)
This commit is contained in:
@@ -57,7 +57,8 @@ class Sms::IncomingMessageService
|
||||
end
|
||||
|
||||
def set_conversation
|
||||
@conversation = @contact_inbox.conversations.last
|
||||
# if lock to single conversation is disabled, we will create a new conversation if previous conversation is resolved
|
||||
@conversation = @inbox.lock_to_single_conversation ? @contact_inbox.conversations.last : @contact_inbox.conversations.open.last
|
||||
return if @conversation
|
||||
|
||||
@conversation = ::Conversation.create!(conversation_params)
|
||||
|
||||
@@ -68,7 +68,8 @@ class Twilio::IncomingMessageService
|
||||
end
|
||||
|
||||
def set_conversation
|
||||
@conversation = @contact_inbox.conversations.first
|
||||
# if lock to single conversation is disabled, we will create a new conversation if previous conversation is resolved
|
||||
@conversation = @inbox.lock_to_single_conversation ? @contact_inbox.conversations.last : @contact_inbox.conversations.open.last
|
||||
return if @conversation
|
||||
|
||||
@conversation = ::Conversation.create!(conversation_params)
|
||||
|
||||
@@ -91,7 +91,8 @@ class Whatsapp::IncomingMessageBaseService
|
||||
end
|
||||
|
||||
def set_conversation
|
||||
@conversation = @contact_inbox.conversations.last
|
||||
# if lock to single conversation is disabled, we will create a new conversation if previous conversation is resolved
|
||||
@conversation = @inbox.lock_to_single_conversation ? @contact_inbox.conversations.last : @contact_inbox.conversations.open.last
|
||||
return if @conversation
|
||||
|
||||
@conversation = ::Conversation.create!(conversation_params)
|
||||
|
||||
Reference in New Issue
Block a user