Skip to content

Commit

Permalink
fix: Fixed send message to lids
Browse files Browse the repository at this point in the history
  • Loading branch information
icleitoncosta committed Jan 15, 2025
1 parent 5e55a13 commit a9a81ac
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions src/chat/patch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit a9a81ac

Please sign in to comment.