mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
Update messages-recv.ts
This commit is contained in:
committed by
Adhiraj Singh
parent
ba3db3ee1a
commit
c113e683e7
@@ -20,6 +20,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
|||||||
ev,
|
ev,
|
||||||
authState,
|
authState,
|
||||||
ws,
|
ws,
|
||||||
|
query,
|
||||||
processingMutex,
|
processingMutex,
|
||||||
upsertMessage,
|
upsertMessage,
|
||||||
resyncAppState,
|
resyncAppState,
|
||||||
@@ -65,28 +66,26 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
|||||||
await sendNode(stanza)
|
await sendNode(stanza)
|
||||||
}
|
}
|
||||||
|
|
||||||
const rejectCall = async(call_id: string) => {
|
const rejectCall = async(callId: string) => {
|
||||||
const _call_offer = (call_id ? callOfferData[call_id] : callOfferData[Object.keys(callOfferData)[0]]);
|
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: _call_offer.from,
|
to: callOffer.from,
|
||||||
id: (new Date().getTime() / 1000).toString().replace('.', '-'),
|
id: (new Date().getTime() / 1000).toString().replace('.', '-'),
|
||||||
},
|
},
|
||||||
content: [{
|
content: [{
|
||||||
tag: 'reject',
|
tag: 'reject',
|
||||||
attrs: {
|
attrs: {
|
||||||
'call-id': call_id,
|
'call-id': callId,
|
||||||
'call-creator': _call_offer.from,
|
'call-creator': callOffer.from,
|
||||||
count: '0',
|
count: '0',
|
||||||
},
|
},
|
||||||
content: undefined,
|
content: undefined,
|
||||||
}],
|
}],
|
||||||
}
|
});
|
||||||
|
await query(stanza)
|
||||||
logger.debug({ call_id, caller: _call_offer.from, me: authState.creds.me!.id, }, 'rejecting call')
|
|
||||||
await sendNode(stanza)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const sendRetryRequest = async(node: BinaryNode, forceIncludeKeys = false) => {
|
const sendRetryRequest = async(node: BinaryNode, forceIncludeKeys = false) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user