From 5113b97bbc46a357992eb8d38cb18d8d46104f7a Mon Sep 17 00:00:00 2001 From: MathMan05 Date: Thu, 26 Feb 2026 14:51:11 -0600 Subject: sign 'em --- src/api/util/handlers/Message.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/api/util') diff --git a/src/api/util/handlers/Message.ts b/src/api/util/handlers/Message.ts index f73b62fb3..94d469985 100644 --- a/src/api/util/handlers/Message.ts +++ b/src/api/util/handlers/Message.ts @@ -163,8 +163,20 @@ async function processMedia(media: UnfurledMediaItem, messageId: string, batchId } const cloneRespBody = (await cloneResponse.json()) as { success: boolean; new_path: string }; + + const realAtt = Attachment.create({ + filename: attEnt.userFilename, + url: `${Config.get().cdn.endpointPublic}/${cloneRespBody.new_path}`, + proxy_url: `${Config.get().cdn.endpointPublic}/${cloneRespBody.new_path}`, + size: attEnt.size, + height: attEnt.height, + width: attEnt.width, + content_type: attEnt.contentType || attEnt.userOriginalContentType, + }); + await realAtt.save(); + //TODO maybe this needs to be a new DB object? I don't see a reason to do this rn though, though this id *should* technically be different from the id of the attachment - media.id = attEnt.id; + media.id = realAtt.id; media.proxy_url = `${Config.get().cdn.endpointPublic}/${cloneRespBody.new_path}`; if (url.protocol !== "attachment") media.url = media.proxy_url; media.height = attEnt.height; -- cgit 1.5.1