瀏覽代碼

Improved deleteAccount

marinofaggiana 5 年之前
父節點
當前提交
268f32a0b6
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      iOSClient/AppDelegate.m

+ 6 - 0
iOSClient/AppDelegate.m

@@ -388,6 +388,12 @@ PKPushRegistry *pushRegistry;
     [self unsubscribingNextcloudServerPushNotification:account url:self.activeUrl withSubscribing:false];
     [self settingActiveAccount:nil activeUrl:nil activeUser:nil activeUserID:nil activePassword:nil];
     
+    /* DELETE ALL FILES LOCAL FS */
+    NSArray *results = [[NCManageDatabase sharedInstance] getTableLocalFilesWithPredicate:[NSPredicate predicateWithFormat:@"account == %@", account] sorted:@"ocId" ascending:NO];
+    for (tableLocalFile *result in results) {
+        [CCUtility removeFileAtPath:[CCUtility getDirectoryProviderStorageOcId:result.ocId]];
+    }
+    // Clear database
     [[NCManageDatabase sharedInstance] clearDatabaseWithAccount:account removeAccount:true];
 
     [CCUtility clearAllKeysEndToEnd:account];