From 89b28a438bd95d297ccfdb72a3e385bd59a62a75 Mon Sep 17 00:00:00 2001 From: AstroX11 Date: Mon, 24 Feb 2025 02:24:44 +0100 Subject: [PATCH] feat: add Id support for desktop (#1240) * feat: add Id support for desktop This commit adjusts the ID length check for desktop, fixing the issue where some desktop IDs were incorrectly classified as "unknown." Baileys stopped identifying if a message was from WA Desktop (Based on my observations last Year). This adjustment addresses this issue. * redundancy removed * fix: linting --- src/Utils/messages.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Utils/messages.ts b/src/Utils/messages.ts index 3e80215..1d771f8 100644 --- a/src/Utils/messages.ts +++ b/src/Utils/messages.ts @@ -727,7 +727,11 @@ export const extractMessageContent = (content: WAMessageContent | undefined | nu /** * Returns the device predicted by message ID */ -export const getDevice = (id: string) => /^3A.{18}$/.test(id) ? 'ios' : /^3E.{20}$/.test(id) ? 'web' : /^(.{21}|.{32})$/.test(id) ? 'android' : /^.{18}$/.test(id) ? 'desktop' : 'unknown' +export const getDevice = (id: string) => /^3A.{18}$/.test(id) ? 'ios' : + /^3E.{20}$/.test(id) ? 'web' : + /^(.{21}|.{32})$/.test(id) ? 'android' : + /^(3F|.{18}$)/.test(id) ? 'desktop' : + 'unknown' /** Upserts a receipt in the message */ export const updateMessageWithReceipt = (msg: Pick, receipt: MessageUserReceipt) => {