From 87fdcbebf669b5a34da7540bf71cdd4498a4210a Mon Sep 17 00:00:00 2001 From: devlikepro Date: Mon, 22 Sep 2025 12:01:46 +0700 Subject: [PATCH] [core] NOWEB Use directPath for newsletters --- src/core/engines/noweb/session.noweb.core.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/core/engines/noweb/session.noweb.core.ts b/src/core/engines/noweb/session.noweb.core.ts index 3212b98a..c1a2ba57 100644 --- a/src/core/engines/noweb/session.noweb.core.ts +++ b/src/core/engines/noweb/session.noweb.core.ts @@ -2577,11 +2577,16 @@ export class NOWEBEngineMediaProcessor implements IMediaEngineProcessor { async getMediaBuffer(message: any): Promise { const content = extractMediaContent(message.message); + const url = content.url; // Fix Stickers // https://github.com/devlikeapro/waha/issues/504 - const url = content.url; + // Set it to null so the engine handles it right if (!hasPath(url)) { - // Set it to null so the engine handles it right + content.url = null; + } + // Fix Newsletter + // directPath has the unencrypted path + if (isJidNewsletter(message.key.remoteJid) && content.directPath) { content.url = null; } @@ -2594,8 +2599,7 @@ export class NOWEBEngineMediaProcessor implements IMediaEngineProcessor { reuploadRequest: this.session.sock.updateMediaMessage, }, ).finally(() => { - // Fix Stickers - set url back, just to have it in the response - // https://github.com/devlikeapro/waha/issues/504 + // Set url back in case we removed it content.url = url; })) as Buffer; }