refactor(voice): read call state from message.call on the frontend

- VoiceCall bubble, voice.js helper, ConversationCard, and the store
  mutation all switch from message.content_attributes.data to message.call.
- Message.vue gains a `call` prop that's provided through
  useMessageContext for the bubble.
- UPDATE_MESSAGE_CALL_STATUS mutation now updates message.call.status,
  matched by provider_call_id.
- content_attributes.data is still emitted by the backend for this
  commit; backend-side trim lands in a follow-up.
This commit is contained in:
Muhsin
2026-04-20 13:36:26 +04:00
parent 5ce77eedbe
commit c2a851c756
6 changed files with 59 additions and 39 deletions
@@ -97,10 +97,13 @@ const lastMessageInChat = computed(() => getLastMessage(props.chat));
const voiceCallData = computed(() => {
const last = lastMessageInChat.value;
if (last?.content_type !== 'voice_call')
if (last?.content_type !== 'voice_call' || !last.call) {
return { status: null, direction: null };
const data = last.content_attributes?.data ?? {};
return { status: data.status, direction: data.call_direction };
}
return {
status: last.call.status,
direction: last.call.direction === 'outgoing' ? 'outbound' : 'inbound',
};
});
const inboxId = computed(() => props.chat.inbox_id);