Update messages-recv.ts

This commit is contained in:
Rahul Kasireddy
2022-08-14 12:04:24 +05:30
committed by Adhiraj Singh
parent ba3db3ee1a
commit c113e683e7

View File

@@ -20,6 +20,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
ev,
authState,
ws,
query,
processingMutex,
upsertMessage,
resyncAppState,
@@ -65,28 +66,26 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
await sendNode(stanza)
}
const rejectCall = async(call_id: string) => {
const _call_offer = (call_id ? callOfferData[call_id] : callOfferData[Object.keys(callOfferData)[0]]);
const stanza: BinaryNode = {
const rejectCall = async(callId: string) => {
const callOffer = callOfferData[callId]: WACallEvent;
const stanza: BinaryNode = ({
tag: 'call',
attrs: {
from: authState.creds.me!.id,
to: _call_offer.from,
to: callOffer.from,
id: (new Date().getTime() / 1000).toString().replace('.', '-'),
},
content: [{
tag: 'reject',
attrs: {
'call-id': call_id,
'call-creator': _call_offer.from,
'call-id': callId,
'call-creator': callOffer.from,
count: '0',
},
content: undefined,
}],
}
logger.debug({ call_id, caller: _call_offer.from, me: authState.creds.me!.id, }, 'rejecting call')
await sendNode(stanza)
});
await query(stanza)
}
const sendRetryRequest = async(node: BinaryNode, forceIncludeKeys = false) => {