From a9a81ac83bb4beba68a3e91aafc54aa61ade45f1 Mon Sep 17 00:00:00 2001 From: icleitoncosta Date: Tue, 14 Jan 2025 20:11:32 -0300 Subject: [PATCH] fix: Fixed send message to lids --- src/chat/patch.ts | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/chat/patch.ts b/src/chat/patch.ts index 38ddbe3d27..4f79791641 100644 --- a/src/chat/patch.ts +++ b/src/chat/patch.ts @@ -15,10 +15,9 @@ */ import * as webpack from '../webpack'; -import { ChatModel, functions } from '../whatsapp'; +import { ChatModel, functions, Lid1X1MigrationUtils } from '../whatsapp'; import { wrapModuleFunction } from '../whatsapp/exportModule'; import { - findOrCreateLatestChat, isUnreadTypeMsg, mediaTypeFromProtobuf, typeAttributeFromProtobuf, @@ -86,19 +85,9 @@ function applyPatch() { /** * Fixed error on try send message to some lids */ - wrapModuleFunction(findOrCreateLatestChat, async (func, ...args) => { - const [chat, type] = args; - - if (chat.isLid() && type != 'username_contactless_search') { - try { - return await func(...args); - } catch (error) { - return await func(chat, 'username_contactless_search'); - } - } - - return await func(...args); - }); + if (typeof Lid1X1MigrationUtils.isLidMigrated === 'function') { + Lid1X1MigrationUtils.isLidMigrated = () => true; + } } function applyPatchModel() {