Ver código fonte

Disable caching reuploaded encrypted files

Tulir Asokan 2 anos atrás
pai
commit
e183f5cffa
1 arquivos alterados com 4 adições e 1 exclusões
  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
 }