mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
remove duplicated call reject event / add terminate tag (#1031)
* initial commit * add terminate tag * lint * lint 2 * Update src/Socket/messages-recv.ts * chore: linting --------- Co-authored-by: Rajeh Taher <rajeh@reforward.dev>
This commit is contained in:
@@ -909,7 +909,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// delete data once call has ended
|
// delete data once call has ended
|
||||||
if(status === 'reject' || status === 'accept' || status === 'timeout') {
|
if(status === 'reject' || status === 'accept' || status === 'timeout' || status === 'terminate') {
|
||||||
callOfferCache.del(call.id)
|
callOfferCache.del(call.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
export type WACallUpdateType = 'offer' | 'ringing' | 'timeout' | 'reject' | 'accept'
|
export type WACallUpdateType = 'offer' | 'ringing' | 'timeout' | 'reject' | 'accept' | 'terminate'
|
||||||
|
|
||||||
export type WACallEvent = {
|
export type WACallEvent = {
|
||||||
chatId: string
|
chatId: string
|
||||||
|
|||||||
@@ -364,7 +364,8 @@ export const getCallStatusFromNode = ({ tag, attrs }: BinaryNode) => {
|
|||||||
if(attrs.reason === 'timeout') {
|
if(attrs.reason === 'timeout') {
|
||||||
status = 'timeout'
|
status = 'timeout'
|
||||||
} else {
|
} else {
|
||||||
status = 'reject'
|
//fired when accepted/rejected/timeout/caller hangs up
|
||||||
|
status = 'terminate'
|
||||||
}
|
}
|
||||||
|
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user