share, receive, request, all you want

This commit is contained in:
Rajeh Taher
2023-10-01 21:43:00 +00:00
parent a11d2deaa5
commit 7cc604a9b5
5 changed files with 26 additions and 2 deletions

View File

@@ -660,6 +660,13 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
signalRepository,
logger,
)
if(msg.message?.protocolMessage?.type === proto.Message.ProtocolMessage.Type.SHARE_PHONE_NUMBER) {
if(node.attrs.sender_pn) {
ev.emit('chats.phoneNumberShare', { lid: node.attrs.from, jid: node.attrs.sender_pn })
}
}
if(shouldIgnoreJid(msg.key.remoteJid!)) {
logger.debug({ key: msg.key }, 'ignored message')
await sendMessageAck(node)

View File

@@ -304,6 +304,8 @@ export const makeMessagesSocket = (config: SocketConfig) => {
message: proto.IMessage,
{ messageId: msgId, participant, additionalAttributes, useUserDevicesCache, cachedGroupMetadata, statusJidList }: MessageRelayOptions
) => {
const meId = authState.creds.me!.id
let shouldIncludeDeviceIdentity = false
const { user, server } = jidDecode(jid)!
@@ -311,7 +313,6 @@ export const makeMessagesSocket = (config: SocketConfig) => {
const isGroup = server === 'g.us'
const isStatus = jid === statusJid
const isLid = server === 'lid'
const meId = authState.creds.me!.id
msgId = msgId || generateMessageID()
useUserDevicesCache = useUserDevicesCache !== false