mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix(master): linting and making functionality better
This commit is contained in:
@@ -600,7 +600,7 @@ export const makeChatsSocket = (config: SocketConfig) => {
|
|||||||
const jid = attrs.from
|
const jid = attrs.from
|
||||||
const participant = attrs.participant || attrs.from
|
const participant = attrs.participant || attrs.from
|
||||||
|
|
||||||
if(shouldIgnoreJid(jid) && jid != '@s.whatsapp.net') {
|
if(shouldIgnoreJid(jid) && jid !== '@s.whatsapp.net') {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -651,7 +651,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
|||||||
|
|
||||||
const handleNotification = async(node: BinaryNode) => {
|
const handleNotification = async(node: BinaryNode) => {
|
||||||
const remoteJid = node.attrs.from
|
const remoteJid = node.attrs.from
|
||||||
if(shouldIgnoreJid(remoteJid) && remoteJid != '@s.whatsapp.net') {
|
if(shouldIgnoreJid(remoteJid) && remoteJid !== '@s.whatsapp.net') {
|
||||||
logger.debug({ remoteJid, id: node.attrs.id }, 'ignored notification')
|
logger.debug({ remoteJid, id: node.attrs.id }, 'ignored notification')
|
||||||
await sendMessageAck(node)
|
await sendMessageAck(node)
|
||||||
return
|
return
|
||||||
@@ -683,6 +683,12 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleMessage = async(node: BinaryNode) => {
|
const handleMessage = async(node: BinaryNode) => {
|
||||||
|
if(shouldIgnoreJid(msg.key.remoteJid!) && msg.key.remoteJid! !== '@s.whatsapp.net') {
|
||||||
|
logger.debug({ key: msg.key }, 'ignored message')
|
||||||
|
await sendMessageAck(node)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const { fullMessage: msg, category, author, decrypt } = decryptMessageNode(
|
const { fullMessage: msg, category, author, decrypt } = decryptMessageNode(
|
||||||
node,
|
node,
|
||||||
authState.creds.me!.id,
|
authState.creds.me!.id,
|
||||||
@@ -697,12 +703,6 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(shouldIgnoreJid(msg.key.remoteJid!) && msg.key.remoteJid! != '@s.whatsapp.net') {
|
|
||||||
logger.debug({ key: msg.key }, 'ignored message')
|
|
||||||
await sendMessageAck(node)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
processingMutex.mutex(
|
processingMutex.mutex(
|
||||||
async() => {
|
async() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user