skylerss 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Socket/chats.js +1 -5
- package/package.json +1 -1
package/lib/Socket/chats.js
CHANGED
|
@@ -284,22 +284,18 @@ const makeChatsSocket = (config) => {
|
|
|
284
284
|
|
|
285
285
|
if ((0, WABinary_1.isLidUser)(normalizedJid)) {
|
|
286
286
|
lid = normalizedJid;
|
|
287
|
-
// Se for LID, idealmente precisaríamos do PN para bloquear
|
|
288
|
-
// Como não temos Store, tentamos sem pn_jid primeiro ou buscamos via USync
|
|
289
287
|
} else if ((0, WABinary_1.isPnUser)(normalizedJid)) {
|
|
290
|
-
// Se for PN, o WhatsApp exige o LID para o campo 'jid' e o PN para 'pn_jid'
|
|
291
288
|
const result = await onWhatsApp(normalizedJid);
|
|
292
289
|
if (result && result[0] && result[0].lid) {
|
|
293
290
|
lid = result[0].lid;
|
|
294
291
|
pn_jid = normalizedJid;
|
|
295
292
|
} else {
|
|
296
|
-
// Fallback: se não achar LID, tenta enviar o JID original (pode falhar com 400 em contas novas)
|
|
297
293
|
lid = normalizedJid;
|
|
298
294
|
}
|
|
299
295
|
}
|
|
300
296
|
|
|
301
297
|
const itemAttrs = { action, jid: lid };
|
|
302
|
-
if (action === 'block' && pn_jid) {
|
|
298
|
+
if (action === 'block' && pn_jid && lid !== pn_jid) {
|
|
303
299
|
itemAttrs.pn_jid = pn_jid;
|
|
304
300
|
}
|
|
305
301
|
|