diff --git a/code/rest/matter_controller.go b/code/rest/matter_controller.go index 36421e4..4587475 100644 --- a/code/rest/matter_controller.go +++ b/code/rest/matter_controller.go @@ -14,6 +14,7 @@ type MatterController struct { BaseController matterDao *MatterDao matterService *MatterService + preferenceService *PreferenceService downloadTokenDao *DownloadTokenDao imageCacheDao *ImageCacheDao shareDao *ShareDao diff --git a/code/rest/matter_service.go b/code/rest/matter_service.go index 16739ba..8908dfd 100644 --- a/code/rest/matter_service.go +++ b/code/rest/matter_service.go @@ -315,7 +315,14 @@ func (this *MatterService) AtomicSoftDelete(request *http.Request, matter *Matte this.userService.MatterLock(matter.UserUuid) defer this.userService.MatterUnlock(matter.UserUuid) - this.SoftDelete(request, matter, user) + //if disabled the recycle feature. then we hard delete. + preference := this.preferenceService.Fetch() + if preference.DeletedKeepDays == 0 { + this.Delete(request, matter, user) + } else { + this.SoftDelete(request, matter, user) + } + } //atomic recovery delete files