From 7196e690a22f77fa39f89222e2fd9a8a59fefcf2 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Tue, 27 Oct 2020 18:11:59 +0200 Subject: [PATCH] For 'original' attachments, always use the attachment link from the DMs, even in staff replies --- src/data/Thread.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/data/Thread.js b/src/data/Thread.js index c0f331a..371a034 100644 --- a/src/data/Thread.js +++ b/src/data/Thread.js @@ -274,8 +274,13 @@ class Thread { return false; } + // Special case: "original" attachments + if (config.attachmentStorage === "original") { + threadMessage.attachments = dmMessage.attachments.map(att => att.url); + } + threadMessage.dm_message_id = dmMessage.id; - await this._updateThreadMessage(threadMessage.id, { dm_message_id: dmMessage.id }); + await this._updateThreadMessage(threadMessage.id, threadMessage.getSQLProps()); // Show the reply in the inbox thread const inboxMessage = await this._postToThreadChannel(inboxContent, files);