feat: eventMessage sending / call link creation (#1677)
This commit is contained in:
@@ -655,6 +655,10 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
||||
return 'poll'
|
||||
}
|
||||
|
||||
if (message.eventMessage) {
|
||||
return 'event'
|
||||
}
|
||||
|
||||
return 'text'
|
||||
}
|
||||
|
||||
@@ -817,12 +821,14 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
||||
}),
|
||||
//TODO: CACHE
|
||||
getProfilePicUrl: sock.profilePictureUrl,
|
||||
getCallLink: sock.createCallLink,
|
||||
upload: waUploadToServer,
|
||||
mediaCache: config.mediaCache,
|
||||
options: config.options,
|
||||
messageId: generateMessageIDV2(sock.user?.id),
|
||||
...options
|
||||
})
|
||||
const isEventMsg = 'event' in content && !!content.event
|
||||
const isDeleteMsg = 'delete' in content && !!content.delete
|
||||
const isEditMsg = 'edit' in content && !!content.edit
|
||||
const isPinMsg = 'pin' in content && !!content.pin
|
||||
@@ -848,6 +854,13 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
||||
polltype: 'creation'
|
||||
}
|
||||
} as BinaryNode)
|
||||
} else if (isEventMsg) {
|
||||
additionalNodes.push({
|
||||
tag: 'meta',
|
||||
attrs: {
|
||||
event_type: 'creation'
|
||||
}
|
||||
} as BinaryNode)
|
||||
}
|
||||
|
||||
if ('cachedGroupMetadata' in options) {
|
||||
|
||||
Reference in New Issue
Block a user