diff --git a/src/config.js b/src/config.js index d2fba6b..d4d8b95 100644 --- a/src/config.js +++ b/src/config.js @@ -32,6 +32,8 @@ const defaultConfig = { "greetingMessage": null, "greetingAttachment": null, + "relaySmallAttachmentsAsAttachments": false, + "port": 8890, "url": null, diff --git a/src/data/Thread.js b/src/data/Thread.js index a0feaa4..0240567 100644 --- a/src/data/Thread.js +++ b/src/data/Thread.js @@ -108,11 +108,11 @@ class Thread { const formatted = '\n\n' + await utils.formatAttachment(attachment); logContent += formatted; // Logs always contain the link - if (attachment.size > 1024 * 1024 * 2) { - threadContent += formatted; - } else { + if (config.relaySmallAttachmentsAsAttachments && attachment.size <= 1024 * 1024 * 2) { const file = await attachments.attachmentToFile(attachment); attachmentFiles.push(file); + } else { + threadContent += formatted; } }