This commit is contained in:
Marino Faggiana 2018-11-29 11:43:17 +01:00 коммит произвёл Marino Faggiana
Родитель 8d648befc1
Коммит b900856ca6
2 изменённых файлов: 6 добавлений и 10 удалений

Просмотреть файл

@ -2580,24 +2580,20 @@ class NCManageDatabase: NSObject {
}
let realm = try! Realm()
var filter = ""
var predicate = NSPredicate()
realm.beginWrite()
if fileID != nil {
if fileID == nil {
filter = "account =" + tableAccount.account
predicate = NSPredicate(format: "account == %@", tableAccount.account)
} else {
filter = "account =" + tableAccount.account + " AND fileID = " + fileID!
}
guard let result = realm.objects(tableTrash.self).filter(filter).first else {
realm.cancelWrite()
return
predicate = NSPredicate(format: "account = %@ AND fileID = %@", tableAccount.account, fileID!)
}
let result = realm.objects(tableTrash.self).filter(predicate)
realm.delete(result)
do {

Просмотреть файл

@ -2484,7 +2484,7 @@
[communication setCredentialsWithUser:_activeUser andUserID:_activeUserID andPassword:_activePassword];
[communication setUserAgent:[CCUtility getUserAgent]];
NSString *path = [NSString stringWithFormat:@"%@%@/trashbin/%@/trash", _activeUrl, k_webDAV, _activeUserID];
NSString *path = [NSString stringWithFormat:@"%@%@/trashbin/%@/trash", _activeUrl, k_dav, _activeUserID];
[communication emptyTrash:path onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSString *redirectedServer) {