mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
Merge branch 'master' into call
This commit is contained in:
@@ -398,7 +398,6 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
||||
for(const { attrs } of blocklists) {
|
||||
const blocklist = [attrs.jid]
|
||||
const type = (attrs.action === 'block') ? 'add' : 'remove'
|
||||
|
||||
ev.emit('blocklist.update', { blocklist, type })
|
||||
}
|
||||
}
|
||||
@@ -541,7 +540,8 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
||||
|
||||
const handleReceipt = async(node: BinaryNode) => {
|
||||
const { attrs, content } = node
|
||||
const isNodeFromMe = areJidsSameUser(attrs.participant || attrs.from, authState.creds.me?.id)
|
||||
const isLid = attrs.from.includes('lid')
|
||||
const isNodeFromMe = areJidsSameUser(attrs.participant || attrs.from, isLid ? authState.creds.me?.lid : authState.creds.me?.id)
|
||||
const remoteJid = !isNodeFromMe || isJidGroup(attrs.from) ? attrs.from : attrs.recipient
|
||||
const fromMe = !attrs.recipient || (attrs.type === 'retry' && isNodeFromMe)
|
||||
|
||||
@@ -664,9 +664,17 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
||||
const { fullMessage: msg, category, author, decrypt } = decryptMessageNode(
|
||||
node,
|
||||
authState.creds.me!.id,
|
||||
authState.creds.me!.lid || '',
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user