もともとセンシティブではないと連合されていたファイルがセンシティブとして連合された場合にセンシティブとしてそのファイルを扱うように (#13879)
* feat(backend): mark an file as sensitive if the file was newly federated as sensitive * docs(changelog): もともとセンシティブではないと連合されていたファイルがセンシティブとして連合された場合にセンシティブとしてそのファイルを扱うように * fix: change way to update federated image * Update packages/backend/src/core/DriveService.ts Co-authored-by: Sayamame-beans <61457993+Sayamame-beans@users.noreply.github.com> * update isSensitive of existing record object --------- Co-authored-by: Sayamame-beans <61457993+Sayamame-beans@users.noreply.github.com>
This commit is contained in:
@@ -504,6 +504,12 @@ export class DriveService {
|
||||
|
||||
if (much) {
|
||||
this.registerLogger.info(`file with same hash is found: ${much.id}`);
|
||||
if (sensitive && !much.isSensitive) {
|
||||
// The file is federated as sensitive for this time, but was federated as non-sensitive before.
|
||||
// Therefore, update the file to sensitive.
|
||||
await this.driveFilesRepository.update({ id: much.id }, { isSensitive: true });
|
||||
much.isSensitive = true;
|
||||
}
|
||||
return much;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user