Browse Source

Disable caching reuploaded encrypted files

Tulir Asokan 2 năm trước cách đây
mục cha
commit
e183f5cffa
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 4 1
      attachments.go

+ 4 - 1
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
 }