From d5e3d049c4d53cbad71c636106fac4e4c60ca5b0 Mon Sep 17 00:00:00 2001 From: Adhiraj Singh Date: Mon, 22 Nov 2021 00:16:22 +0530 Subject: [PATCH] fix: add "offer" call ack --- src/Socket/messages-recv.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Socket/messages-recv.ts b/src/Socket/messages-recv.ts index 97d7b12..3fc67e6 100644 --- a/src/Socket/messages-recv.ts +++ b/src/Socket/messages-recv.ts @@ -7,6 +7,8 @@ import { KEY_BUNDLE_TYPE } from "../Defaults" import { makeChatsSocket } from "./chats" import { extractGroupMetadata } from "./groups" +const CALL_TAGS_TO_ACK = ['terminate', 'relaylatency', 'offer'] + const isReadReceipt = (type: string) => type === 'read' || type === 'read-self' export const makeMessagesRecvSocket = (config: SocketConfig) => { @@ -465,7 +467,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => { logger.info({ node }, 'recv call') const [child] = getAllBinaryNodeChildren(node) - if(child.tag === 'terminate' || child.tag === 'relaylatency') { + if(CALL_TAGS_TO_ACK.includes(child.tag)) { await sendMessageAck(node, { class: 'call', type: child.tag }) } })