Disable small attachment relaying by default, add option for it

master
Dragory 2018-02-18 20:06:24 +02:00
parent 43d80f5912
commit 8a77bf1849
2 changed files with 5 additions and 3 deletions

View File

@ -32,6 +32,8 @@ const defaultConfig = {
"greetingMessage": null,
"greetingAttachment": null,
"relaySmallAttachmentsAsAttachments": false,
"port": 8890,
"url": null,

View File

@ -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;
}
}