Update messages-recv.ts

This commit is contained in:
Rahul Kasireddy
2022-08-14 12:07:06 +05:30
committed by Adhiraj Singh
parent c113e683e7
commit d05f40b348

View File

@@ -66,20 +66,19 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
await sendNode(stanza) await sendNode(stanza)
} }
const rejectCall = async(callId: string) => { const rejectCall = async(callId: string, callFrom: string) => {
const callOffer = callOfferData[callId]: WACallEvent;
const stanza: BinaryNode = ({ const stanza: BinaryNode = ({
tag: 'call', tag: 'call',
attrs: { attrs: {
from: authState.creds.me!.id, from: authState.creds.me!.id,
to: callOffer.from, to: callFrom,
id: (new Date().getTime() / 1000).toString().replace('.', '-'), id: (new Date().getTime() / 1000).toString().replace('.', '-'),
}, },
content: [{ content: [{
tag: 'reject', tag: 'reject',
attrs: { attrs: {
'call-id': callId, 'call-id': callId,
'call-creator': callOffer.from, 'call-creator': callFrom,
count: '0', count: '0',
}, },
content: undefined, content: undefined,