From e183f5cffaf8f03d90af1c6c672ca6f0bf5d0969 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Mon, 30 Jan 2023 01:01:10 +0200 Subject: [PATCH] Disable caching reuploaded encrypted files --- attachments.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/attachments.go b/attachments.go index a47cba8..51255ab 100644 --- a/attachments.go +++ b/attachments.go @@ -140,7 +140,10 @@ func (br *DiscordBridge) uploadMatrixAttachment(intent *appservice.IntentAPI, da } dbFile.MXC = uploaded.ContentURI } - dbFile.Insert(nil) + // TODO add option to cache encrypted files too? + if !dbFile.Encrypted { + dbFile.Insert(nil) + } return dbFile, nil }