Merge branch 'feat/whatsapp-call-incoming-pipeline' into feat/whatsapp-call-meta-bridge

This commit is contained in:
Tanmay Deep Sharma
2026-05-08 12:20:02 +05:30
@@ -42,12 +42,16 @@ class Api::V1::Accounts::Contacts::CallsController < Api::V1::Accounts::BaseCont
# Reuse the open conversation when the caller is already inside it; ignore
# the hint if it doesn't belong to the picked voice inbox or dialed contact.
# Only reuse open conversations — Message#reopen_conversation skips outgoing
# messages, so dropping a voice_call bubble into a resolved/snoozed/pending
# thread leaves it stuck in that state.
def existing_conversation
return nil if params[:conversation_id].blank?
conversation = Current.account.conversations.find_by(display_id: params[:conversation_id])
return nil unless conversation
return nil unless conversation.inbox_id == voice_inbox.id && conversation.contact_id == contact.id
return nil unless conversation.open?
conversation
end