Skip to content

Commit 3f567db

Browse files
authored
fix(baileys): correct JID filter in markMessageAsRead for all user types (#2418)
The condition used isPnUser() which only matches @pn.whatsapp.net JIDs, silently excluding normal users (@s.whatsapp.net) and LID users (@lid). Messages were never actually marked as read for these JID types. Replace allowlist approach (isJidGroup || isPnUser) with denylist (!isJidBroadcast && !isJidNewsletter) to correctly include all valid user and group JIDs while excluding only broadcast and newsletter JIDs. Fixes #2277
1 parent 555fa66 commit 3f567db

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4152,7 +4152,7 @@ export class BaileysStartupService extends ChannelStartupService {
41524152
try {
41534153
const keys: proto.IMessageKey[] = [];
41544154
data.readMessages.forEach((read) => {
4155-
if (isJidGroup(read.remoteJid) || isPnUser(read.remoteJid)) {
4155+
if (!isJidBroadcast(read.remoteJid) && !isJidNewsletter(read.remoteJid)) {
41564156
keys.push({ remoteJid: read.remoteJid, fromMe: read.fromMe, id: read.id });
41574157
}
41584158
});

0 commit comments

Comments
 (0)