From 190e6d6bd6c201b7c6787c1e37732ea2bee25d21 Mon Sep 17 00:00:00 2001 From: Adhiraj Singh Date: Fri, 11 Nov 2022 09:38:31 +0530 Subject: [PATCH] chore: ignore presence updates as well --- src/Socket/chats.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Socket/chats.ts b/src/Socket/chats.ts index 9a5eef3..6a2190d 100644 --- a/src/Socket/chats.ts +++ b/src/Socket/chats.ts @@ -14,9 +14,10 @@ export const makeChatsSocket = (config: SocketConfig) => { const { logger, markOnlineOnConnect, - shouldSyncHistoryMessage, fireInitQueries, appStateMacVerification, + shouldIgnoreJid, + shouldSyncHistoryMessage, } = config const sock = makeSocket(config) const { @@ -508,6 +509,11 @@ export const makeChatsSocket = (config: SocketConfig) => { let presence: PresenceData | undefined const jid = attrs.from const participant = attrs.participant || attrs.from + + if(shouldIgnoreJid(jid)) { + return + } + if(tag === 'presence') { presence = { lastKnownPresence: attrs.type === 'unavailable' ? 'unavailable' : 'available',