Disable small attachment relaying by default, add option for it
parent
43d80f5912
commit
8a77bf1849
|
@ -32,6 +32,8 @@ const defaultConfig = {
|
||||||
"greetingMessage": null,
|
"greetingMessage": null,
|
||||||
"greetingAttachment": null,
|
"greetingAttachment": null,
|
||||||
|
|
||||||
|
"relaySmallAttachmentsAsAttachments": false,
|
||||||
|
|
||||||
"port": 8890,
|
"port": 8890,
|
||||||
"url": null,
|
"url": null,
|
||||||
|
|
||||||
|
|
|
@ -108,11 +108,11 @@ class Thread {
|
||||||
const formatted = '\n\n' + await utils.formatAttachment(attachment);
|
const formatted = '\n\n' + await utils.formatAttachment(attachment);
|
||||||
logContent += formatted; // Logs always contain the link
|
logContent += formatted; // Logs always contain the link
|
||||||
|
|
||||||
if (attachment.size > 1024 * 1024 * 2) {
|
if (config.relaySmallAttachmentsAsAttachments && attachment.size <= 1024 * 1024 * 2) {
|
||||||
threadContent += formatted;
|
|
||||||
} else {
|
|
||||||
const file = await attachments.attachmentToFile(attachment);
|
const file = await attachments.attachmentToFile(attachment);
|
||||||
attachmentFiles.push(file);
|
attachmentFiles.push(file);
|
||||||
|
} else {
|
||||||
|
threadContent += formatted;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue