diff --git a/src/whatsapp/functions/fetchLinkPreview.ts b/src/whatsapp/functions/fetchLinkPreview.ts index 1de1967910..838ee9372c 100644 --- a/src/whatsapp/functions/fetchLinkPreview.ts +++ b/src/whatsapp/functions/fetchLinkPreview.ts @@ -58,9 +58,17 @@ export declare function fetchLinkPreview( exportModule( exports, { - fetchLinkPreview: 'default', + fetchLinkPreview: [ + 'getLinkPreview', // @whatsapp >= 2.2329.7 + 'default', // @whatsapp < 2.2329.7 + ], }, (m, id) => { + // @whatsapp >= 2.2329.7 + if (m.getLinkPreview && !m.getAck) { + return true; + } + // @whatsapp < 2.2329.7 const source: string = webpack.moduleSource(id); return ( source.includes('.genMinimalLinkPreview') && diff --git a/src/whatsapp/misc/MediaBlobCache.ts b/src/whatsapp/misc/MediaBlobCache.ts index 626c7b2207..f64c97198b 100644 --- a/src/whatsapp/misc/MediaBlobCache.ts +++ b/src/whatsapp/misc/MediaBlobCache.ts @@ -40,8 +40,16 @@ export declare const MediaBlobCache: MediaBlobCacheImpl; exportModule( exports, { - MediaBlobCacheImpl: 'MediaBlobCacheImpl', - MediaBlobCache: 'MediaBlobCache', + MediaBlobCacheImpl: [ + 'InMemoryMediaBlobCacheImpl', // @whatsapp >= 2.2329.7 + 'MediaBlobCacheImpl', // @whatsapp < 2.2329.7 + ], + MediaBlobCache: [ + 'InMemoryMediaBlobCache', // @whatsapp >= 2.2329.7 + 'MediaBlobCache', // @whatsapp < 2.2329.7 + ], }, - (m) => m.MediaBlobCache + (m) => + m.InMemoryMediaBlobCacheImpl || // @whatsapp >= 2.2329.7 + m.MediaBlobCache // @whatsapp < 2.2329.7 );