feat(call): add caller phone number to offer call event (#2190)
This commit is contained in:
@@ -1349,6 +1349,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
|||||||
const call: WACallEvent = {
|
const call: WACallEvent = {
|
||||||
chatId: attrs.from!,
|
chatId: attrs.from!,
|
||||||
from,
|
from,
|
||||||
|
callerPn: infoChild.attrs['caller_pn'],
|
||||||
id: callId,
|
id: callId,
|
||||||
date: new Date(+attrs.t! * 1000),
|
date: new Date(+attrs.t! * 1000),
|
||||||
offline: !!attrs.offline,
|
offline: !!attrs.offline,
|
||||||
@@ -1368,6 +1369,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
|||||||
if (existingCall) {
|
if (existingCall) {
|
||||||
call.isVideo = existingCall.isVideo
|
call.isVideo = existingCall.isVideo
|
||||||
call.isGroup = existingCall.isGroup
|
call.isGroup = existingCall.isGroup
|
||||||
|
call.callerPn = call.callerPn || existingCall.callerPn
|
||||||
}
|
}
|
||||||
|
|
||||||
// delete data once call has ended
|
// delete data once call has ended
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ export type WACallUpdateType = 'offer' | 'ringing' | 'timeout' | 'reject' | 'acc
|
|||||||
export type WACallEvent = {
|
export type WACallEvent = {
|
||||||
chatId: string
|
chatId: string
|
||||||
from: string
|
from: string
|
||||||
|
callerPn?: string
|
||||||
isGroup?: boolean
|
isGroup?: boolean
|
||||||
groupJid?: string
|
groupJid?: string
|
||||||
id: string
|
id: string
|
||||||
|
|||||||
Reference in New Issue
Block a user