fix: honor whatsapp mediaMaxMb (#505) (thanks @koala73)

This commit is contained in:
Peter Steinberger
2026-01-09 19:51:35 +01:00
parent 3026367c1b
commit 87f432880a
51 changed files with 89 additions and 4089 deletions

View File

@@ -376,7 +376,11 @@ export async function monitorWebInbox(options: {
try {
const inboundMedia = await downloadInboundMedia(msg, sock);
if (inboundMedia) {
const maxBytes = (options.mediaMaxMb ?? 50) * 1024 * 1024;
const maxMb =
typeof options.mediaMaxMb === "number" && options.mediaMaxMb > 0
? options.mediaMaxMb
: 50;
const maxBytes = maxMb * 1024 * 1024;
const saved = await saveMediaBuffer(
inboundMedia.buffer,
inboundMedia.mimetype,