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:
vini
2024-09-22 08:34:29 -03:00
committed by GitHub
parent 70f0321381
commit ed00a57c84
3 changed files with 4 additions and 3 deletions

View File

@@ -909,7 +909,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
}
// 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)
}

View File

@@ -1,5 +1,5 @@
export type WACallUpdateType = 'offer' | 'ringing' | 'timeout' | 'reject' | 'accept'
export type WACallUpdateType = 'offer' | 'ringing' | 'timeout' | 'reject' | 'accept' | 'terminate'
export type WACallEvent = {
chatId: string

View File

@@ -364,7 +364,8 @@ export const getCallStatusFromNode = ({ tag, attrs }: BinaryNode) => {
if(attrs.reason === 'timeout') {
status = 'timeout'
} else {
status = 'reject'
//fired when accepted/rejected/timeout/caller hangs up
status = 'terminate'
}
break