Marino Faggiana 8 лет назад
Родитель
Сommit
81e8cf19f0

+ 0 - 20
Nextcloud.xcodeproj/project.pbxproj

@@ -25,12 +25,6 @@
 		F708CF821E56E8CC00271D8B /* TableDirectory+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = F708CF5C1E56E8CC00271D8B /* TableDirectory+CoreDataProperties.m */; };
 		F708CF831E56E8CC00271D8B /* TableDirectory+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = F708CF5C1E56E8CC00271D8B /* TableDirectory+CoreDataProperties.m */; };
 		F708CF841E56E8CC00271D8B /* TableDirectory+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = F708CF5C1E56E8CC00271D8B /* TableDirectory+CoreDataProperties.m */; };
-		F708CF851E56E8CC00271D8B /* TableShare+CoreDataClass.m in Sources */ = {isa = PBXBuildFile; fileRef = F708CF5E1E56E8CC00271D8B /* TableShare+CoreDataClass.m */; };
-		F708CF861E56E8CC00271D8B /* TableShare+CoreDataClass.m in Sources */ = {isa = PBXBuildFile; fileRef = F708CF5E1E56E8CC00271D8B /* TableShare+CoreDataClass.m */; };
-		F708CF871E56E8CC00271D8B /* TableShare+CoreDataClass.m in Sources */ = {isa = PBXBuildFile; fileRef = F708CF5E1E56E8CC00271D8B /* TableShare+CoreDataClass.m */; };
-		F708CF881E56E8CC00271D8B /* TableShare+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = F708CF601E56E8CC00271D8B /* TableShare+CoreDataProperties.m */; };
-		F708CF891E56E8CC00271D8B /* TableShare+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = F708CF601E56E8CC00271D8B /* TableShare+CoreDataProperties.m */; };
-		F708CF8A1E56E8CC00271D8B /* TableShare+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = F708CF601E56E8CC00271D8B /* TableShare+CoreDataProperties.m */; };
 		F708CF971E56E8CC00271D8B /* TableAccount+CoreDataClass.m in Sources */ = {isa = PBXBuildFile; fileRef = F708CF6A1E56E8CC00271D8B /* TableAccount+CoreDataClass.m */; };
 		F708CF981E56E8CC00271D8B /* TableAccount+CoreDataClass.m in Sources */ = {isa = PBXBuildFile; fileRef = F708CF6A1E56E8CC00271D8B /* TableAccount+CoreDataClass.m */; };
 		F708CF991E56E8CC00271D8B /* TableAccount+CoreDataClass.m in Sources */ = {isa = PBXBuildFile; fileRef = F708CF6A1E56E8CC00271D8B /* TableAccount+CoreDataClass.m */; };
@@ -766,10 +760,6 @@
 		F708CF5A1E56E8CC00271D8B /* TableDirectory+CoreDataClass.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "TableDirectory+CoreDataClass.m"; sourceTree = "<group>"; };
 		F708CF5B1E56E8CC00271D8B /* TableDirectory+CoreDataProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "TableDirectory+CoreDataProperties.h"; sourceTree = "<group>"; };
 		F708CF5C1E56E8CC00271D8B /* TableDirectory+CoreDataProperties.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "TableDirectory+CoreDataProperties.m"; sourceTree = "<group>"; };
-		F708CF5D1E56E8CC00271D8B /* TableShare+CoreDataClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "TableShare+CoreDataClass.h"; sourceTree = "<group>"; };
-		F708CF5E1E56E8CC00271D8B /* TableShare+CoreDataClass.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "TableShare+CoreDataClass.m"; sourceTree = "<group>"; };
-		F708CF5F1E56E8CC00271D8B /* TableShare+CoreDataProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "TableShare+CoreDataProperties.h"; sourceTree = "<group>"; };
-		F708CF601E56E8CC00271D8B /* TableShare+CoreDataProperties.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "TableShare+CoreDataProperties.m"; sourceTree = "<group>"; };
 		F708CF691E56E8CC00271D8B /* TableAccount+CoreDataClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "TableAccount+CoreDataClass.h"; sourceTree = "<group>"; };
 		F708CF6A1E56E8CC00271D8B /* TableAccount+CoreDataClass.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "TableAccount+CoreDataClass.m"; sourceTree = "<group>"; };
 		F708CF6B1E56E8CC00271D8B /* TableAccount+CoreDataProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "TableAccount+CoreDataProperties.h"; sourceTree = "<group>"; };
@@ -2808,10 +2798,6 @@
 				F708CF5A1E56E8CC00271D8B /* TableDirectory+CoreDataClass.m */,
 				F708CF5B1E56E8CC00271D8B /* TableDirectory+CoreDataProperties.h */,
 				F708CF5C1E56E8CC00271D8B /* TableDirectory+CoreDataProperties.m */,
-				F708CF5D1E56E8CC00271D8B /* TableShare+CoreDataClass.h */,
-				F708CF5E1E56E8CC00271D8B /* TableShare+CoreDataClass.m */,
-				F708CF5F1E56E8CC00271D8B /* TableShare+CoreDataProperties.h */,
-				F708CF601E56E8CC00271D8B /* TableShare+CoreDataProperties.m */,
 				F708CF691E56E8CC00271D8B /* TableAccount+CoreDataClass.h */,
 				F708CF6A1E56E8CC00271D8B /* TableAccount+CoreDataClass.m */,
 				F708CF6B1E56E8CC00271D8B /* TableAccount+CoreDataProperties.h */,
@@ -3900,7 +3886,6 @@
 				F71459BE1D12E3B700CAFEEC /* UIImage+Reflection.m in Sources */,
 				F73CC06D1E813DFF006E3047 /* BKPasscodeField.m in Sources */,
 				F71459BF1D12E3B700CAFEEC /* RNEncryptor.m in Sources */,
-				F708CF891E56E8CC00271D8B /* TableShare+CoreDataProperties.m in Sources */,
 				F71459C21D12E3B700CAFEEC /* ShareViewController.m in Sources */,
 				F71459C31D12E3B700CAFEEC /* UIImage+Filtering.m in Sources */,
 				F77EB6281EC08036003F814F /* CCExifGeo.m in Sources */,
@@ -3941,7 +3926,6 @@
 				F71459F71D12E3B700CAFEEC /* CCGraphics.m in Sources */,
 				F786ACAB1EBDCCE60055AE9D /* NCManageDatabase.swift in Sources */,
 				F71459FB1D12E3B700CAFEEC /* PPImageScrollingCellView.m in Sources */,
-				F708CF861E56E8CC00271D8B /* TableShare+CoreDataClass.m in Sources */,
 				F71459FF1D12E3B700CAFEEC /* RNCryptor.m in Sources */,
 				F7145A001D12E3B700CAFEEC /* CCGlobal.m in Sources */,
 				F7145A011D12E3B700CAFEEC /* UIImage+Blurring.m in Sources */,
@@ -3964,7 +3948,6 @@
 			files = (
 				F708CF781E56E8CC00271D8B /* TableLocalFile+CoreDataProperties.m in Sources */,
 				F74344801E127ED3001CC831 /* NSString+Base64.m in Sources */,
-				F708CF871E56E8CC00271D8B /* TableShare+CoreDataClass.m in Sources */,
 				F708CF9C1E56E8CC00271D8B /* TableAccount+CoreDataProperties.m in Sources */,
 				F708CF811E56E8CC00271D8B /* TableDirectory+CoreDataClass.m in Sources */,
 				F743448C1E128010001CC831 /* CCCrypto.m in Sources */,
@@ -4005,7 +3988,6 @@
 				F708CF721E56E8CC00271D8B /* TableMetadata+CoreDataProperties.m in Sources */,
 				F74344631E127D79001CC831 /* CCBKPasscode.m in Sources */,
 				F786AC9E1EBDC88B0055AE9D /* NCDatabase.swift in Sources */,
-				F708CF8A1E56E8CC00271D8B /* TableShare+CoreDataProperties.m in Sources */,
 				F74344661E127E35001CC831 /* CCCoreData.m in Sources */,
 				F76B3CD01EAE01BD00921AC9 /* NCBrand.swift in Sources */,
 				F73CC0801E813DFF006E3047 /* BKTouchIDSwitchView.m in Sources */,
@@ -4106,7 +4088,6 @@
 				F77B0E241D118A16002130FE /* HRColorCursor.m in Sources */,
 				F762CAF81EACB66200B38484 /* XLFormButtonCell.m in Sources */,
 				F7A321581E9E2A070069AD1B /* CCSynchronize.m in Sources */,
-				F708CF851E56E8CC00271D8B /* TableShare+CoreDataClass.m in Sources */,
 				F75AE3C71E9D12900088BB09 /* SwiftyAvatar.swift in Sources */,
 				F708CF9A1E56E8CC00271D8B /* TableAccount+CoreDataProperties.m in Sources */,
 				F77B0E261D118A16002130FE /* ZSSTextView.m in Sources */,
@@ -4265,7 +4246,6 @@
 				F708CF7F1E56E8CC00271D8B /* TableDirectory+CoreDataClass.m in Sources */,
 				F77B0EB91D118A16002130FE /* HRColorUtil.m in Sources */,
 				F762CB0F1EACB66200B38484 /* NSObject+XLFormAdditions.m in Sources */,
-				F708CF881E56E8CC00271D8B /* TableShare+CoreDataProperties.m in Sources */,
 				F762CB891EACB81000B38484 /* REMenuItem.m in Sources */,
 				F762CBBB1EACB89C00B38484 /* NSArray+LMMediaPlayerShuffle.m in Sources */,
 				F7F06EA71DBFACC600099AE9 /* CTAssetPlayButton.m in Sources */,

+ 0 - 10
iOSClient/FileSystem/CCCoreData.h

@@ -39,7 +39,6 @@
 #import "TableMetadata+CoreDataClass.h"
 #import "TableDirectory+CoreDataClass.h"
 #import "TableLocalFile+CoreDataClass.h"
-#import "TableShare+CoreDataClass.h"
 
 @interface CCCoreData : NSObject
 
@@ -174,14 +173,6 @@
 + (void)setGeoInformationLocalFromFileID:(NSString *)fileID exifDate:(NSDate *)exifDate exifLatitude:(NSString *)exifLatitude exifLongitude:(NSString *)exifLongitude activeAccount:(NSString *)activeAccount;
 + (void)setGeoInformationLocalNull;
 
-// ===== Share =====
-
-+ (void)setShareLink:(NSString *)share fileName:(NSString *)fileName serverUrl:(NSString *)serverUrl sharesLink:(NSMutableDictionary *)sharesLink activeAccount:(NSString *)activeAccount;
-+ (void)setShareUserAndGroup:(NSString *)share fileName:(NSString *)fileName serverUrl:(NSString *)serverUrl sharesUserAndGroup:(NSMutableDictionary *)sharesUserAndGroup activeAccount:(NSString *)activeAccount;
-+ (void)unShare:(NSString *)share fileName:(NSString *)fileName serverUrl:(NSString *)serverUrl sharesLink:(NSMutableDictionary *)sharesLink sharesUserAndGroup:(NSMutableDictionary *)sharesUserAndGroup activeAccount:(NSString *)activeAccount;
-+ (void)updateShare:(NSDictionary *)items sharesLink:(NSMutableDictionary *)sharesLink sharesUserAndGroup:(NSMutableDictionary *)sharesUserAndGroup activeAccount:(NSString *)activeAccount activeUrl:(NSString *)activeUrl;
-+ (void)populateSharesVariableFromDBActiveAccount:(NSString *)activeAccount sharesLink:(NSMutableDictionary *)sharesLink sharesUserAndGroup:(NSMutableDictionary *)sharesUserAndGroup;
-
 // ===== Offline =====
 
 + (NSArray *)getHomeOfflineActiveAccount:(NSString *)activeAccount directoryUser:(NSString *)directoryUser fieldOrder:(NSString *)fieldOrder ascending:(BOOL)ascending;
@@ -206,7 +197,6 @@
 + (void)flushTableDirectoryAccount:(NSString *)account;
 + (void)flushTableLocalFileAccount:(NSString *)account;
 + (void)flushTableMetadataAccount:(NSString *)account;
-+ (void)flushTableShareAccount:(NSString *)account;
 
 + (void)flushAllDatabase;
 @end

+ 2 - 19
iOSClient/FileSystem/CCCoreData.m

@@ -1459,7 +1459,7 @@
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark ===== Share =====
 #pragma --------------------------------------------------------------------------------------------
-
+/*
 + (void)setShareLink:(NSString *)share fileName:(NSString *)fileName serverUrl:(NSString *)serverUrl sharesLink:(NSMutableDictionary *)sharesLink activeAccount:(NSString *)activeAccount
 {    
     NSManagedObjectContext *context = [NSManagedObjectContext MR_defaultContext];
@@ -1642,7 +1642,7 @@
     
     return;
 }
-
+*/
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark ===== Offline =====
 #pragma --------------------------------------------------------------------------------------------
@@ -2006,22 +2006,6 @@
     [context MR_saveToPersistentStoreAndWait];
 }
 
-+ (void)flushTableShareAccount:(NSString *)account
-{
-    NSManagedObjectContext *context = [NSManagedObjectContext MR_defaultContext];
-    
-    if (account) {
-        
-        [TableShare MR_deleteAllMatchingPredicate:[NSPredicate predicateWithFormat:@"(account == %@)", account] inContext:context];
-        
-    } else {
-        
-        [TableShare MR_truncateAllInContext:context];
-    }
-    
-    [context MR_saveToPersistentStoreAndWait];
-}
-
 
 + (void)flushAllDatabase
 {
@@ -2031,7 +2015,6 @@
     [TableDirectory MR_truncateAllInContext:context];
     [TableLocalFile MR_truncateAllInContext:context];
     [TableMetadata MR_truncateAllInContext:context];
-    [TableShare MR_truncateAllInContext:context];
     
     [context MR_saveToPersistentStoreAndWait];
 }

+ 38 - 16
iOSClient/FileSystem/NCManageDatabase.swift

@@ -438,7 +438,7 @@ class NCManageDatabase: NSObject {
     //MARK: -
     //MARK: Table Share
     
-    func addShareLink(_ share: String, fileName: String, serverUrl: String, sharesLink: inout [String:String], account: String) {
+    func addShareLink(_ share: String, fileName: String, serverUrl: String, account: String) -> [String:String] {
         
         let realm = try! Realm()
         
@@ -465,10 +465,10 @@ class NCManageDatabase: NSObject {
             }
         }
         
-        sharesLink = [share: "\(serverUrl)\(fileName)"]
+        return [share: "\(serverUrl)\(fileName)"]
     }
 
-    func addShareUserAndGroup(_ share: String, fileName: String, serverUrl: String, sharesUserAndGroup: inout [String:String], account: String) {
+    func addShareUserAndGroup(_ share: String, fileName: String, serverUrl: String, account: String) -> [String:String] {
         
         let realm = try! Realm()
         
@@ -495,10 +495,13 @@ class NCManageDatabase: NSObject {
             }
         }
         
-        sharesUserAndGroup = [share: "\(serverUrl)\(fileName)"]
+        return [share: "\(serverUrl)\(fileName)"]
     }
     
-    func unShare(_ share: String, fileName: String, serverUrl: String, sharesLink: inout [String:String], sharesUserAndGroup: inout [String:String], account: String) {
+    func unShare(_ share: String, fileName: String, serverUrl: String, sharesLinkObj: [String:String], sharesUserAndGroupObj: [String:String], account: String) -> [Any] {
+        
+        var sharesLink = sharesLinkObj
+        var sharesUserAndGroup = sharesUserAndGroupObj
         
         let realm = try! Realm()
         
@@ -537,9 +540,11 @@ class NCManageDatabase: NSObject {
                 sharesUserAndGroup.removeValue(forKey: "\(serverUrl)\(fileName)")
             }
         }
+        
+        return [sharesLink, sharesUserAndGroup]
     }
     
-    func removeAllShareActiveAccount(_ account: String, sharesLink: inout [String:String], sharesUserAndGroup: inout [String:String]) {
+    func removeAllShareActiveAccount(_ account: String) {
         
         let realm = try! Realm()
         
@@ -547,14 +552,14 @@ class NCManageDatabase: NSObject {
         try! realm.write {
             realm.delete(results)
         }
-
-        sharesLink.removeAll()
-        sharesUserAndGroup.removeAll()
     }
     
-    func updateShare(_ items: inout [String:OCSharedDto], sharesLink: inout [String:String], sharesUserAndGroup: inout [String:String] , account: String, activeUrl: String) {
+    func updateShare(_ items: [String:OCSharedDto], account: String, activeUrl: String) -> [Any] {
         
-        self.removeAllShareActiveAccount(account, sharesLink: &sharesLink, sharesUserAndGroup: &sharesUserAndGroup)
+        var sharesLink = [String:String]()
+        var sharesUserAndGroup = [String:String]()
+
+        self.removeAllShareActiveAccount(account)
      
         var itemsLink = [OCSharedDto]()
         var itemsUsersAndGroups = [OCSharedDto]()
@@ -584,7 +589,7 @@ class NCManageDatabase: NSObject {
             }
             
             if item.idRemoteShared > 0 {
-                self.addShareLink("\(item.idRemoteShared)", fileName: fileName, serverUrl: serverUrl, sharesLink: &sharesLink, account: account)
+                sharesLink = self.addShareLink("\(item.idRemoteShared)", fileName: fileName, serverUrl: serverUrl, account: account)
             }
         }
         
@@ -606,12 +611,27 @@ class NCManageDatabase: NSObject {
         }
         
         // Write on DB
+        for (key, _) in paths {
+            
+            let items = paths[key]
+            let share = items?.joined(separator: ",")
+            
+            print("[LOG] share \(String(describing: share))")
+            
+            let fullPath = CCUtility.getHomeServerUrlActiveUrl(activeUrl) + "\(key)"
+            let fileName = NSString(string: fullPath).lastPathComponent
+            let serverUrl = NSString(string: fullPath).substring(to: (fullPath.characters.count - (fullPath.characters.count-1)))
+            
+            sharesUserAndGroup = self.addShareUserAndGroup(share!, fileName: fileName, serverUrl: serverUrl, account: account)
+        }
+        
+        return [sharesLink, sharesUserAndGroup]
     }
     
-    func populateSharesVariable(_ account: String, sharesLink: inout [String:String], sharesUserAndGroup: inout [String:String]) {
+    func getSharesAccount(_ account: String) -> [Any] {
 
-        sharesLink.removeAll()
-        sharesUserAndGroup.removeAll()
+        var sharesLink = [String:String]()
+        var sharesUserAndGroup = [String:String]()
         
         let realm = try! Realm()
 
@@ -624,9 +644,11 @@ class NCManageDatabase: NSObject {
             }
             
             if (resultShare.shareUserAndGroup.characters.count > 0) {
-                sharesLink = [resultShare.shareUserAndGroup: "\(resultShare.serverUrl)\(resultShare.fileName)"]
+                sharesUserAndGroup = [resultShare.shareUserAndGroup: "\(resultShare.serverUrl)\(resultShare.fileName)"]
             }
         }
+        
+        return [sharesLink, sharesUserAndGroup]
     }
     
     //MARK: -

+ 0 - 20
iOSClient/FileSystem/TableShare+CoreDataClass.h

@@ -1,20 +0,0 @@
-//
-//  TableShare+CoreDataClass.h
-//  Nextcloud
-//
-//  Created by Marino Faggiana on 17/02/17.
-//  Copyright © 2017 TWS. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-#import <CoreData/CoreData.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface TableShare : NSManagedObject
-
-@end
-
-NS_ASSUME_NONNULL_END
-
-#import "TableShare+CoreDataProperties.h"

+ 0 - 13
iOSClient/FileSystem/TableShare+CoreDataClass.m

@@ -1,13 +0,0 @@
-//
-//  TableShare+CoreDataClass.m
-//  Nextcloud
-//
-//  Created by Marino Faggiana on 17/02/17.
-//  Copyright © 2017 TWS. All rights reserved.
-//
-
-#import "TableShare+CoreDataClass.h"
-
-@implementation TableShare
-
-@end

+ 0 - 26
iOSClient/FileSystem/TableShare+CoreDataProperties.h

@@ -1,26 +0,0 @@
-//
-//  TableShare+CoreDataProperties.h
-//  Nextcloud
-//
-//  Created by Marino Faggiana on 17/02/17.
-//  Copyright © 2017 TWS. All rights reserved.
-//
-
-#import "TableShare+CoreDataClass.h"
-
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface TableShare (CoreDataProperties)
-
-+ (NSFetchRequest<TableShare *> *)fetchRequest;
-
-@property (nullable, nonatomic, copy) NSString *account;
-@property (nullable, nonatomic, copy) NSString *fileName;
-@property (nullable, nonatomic, copy) NSString *serverUrl;
-@property (nullable, nonatomic, copy) NSString *shareLink;
-@property (nullable, nonatomic, copy) NSString *shareUserAndGroup;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 23
iOSClient/FileSystem/TableShare+CoreDataProperties.m

@@ -1,23 +0,0 @@
-//
-//  TableShare+CoreDataProperties.m
-//  Nextcloud
-//
-//  Created by Marino Faggiana on 17/02/17.
-//  Copyright © 2017 TWS. All rights reserved.
-//
-
-#import "TableShare+CoreDataProperties.h"
-
-@implementation TableShare (CoreDataProperties)
-
-+ (NSFetchRequest<TableShare *> *)fetchRequest {
-	return [[NSFetchRequest alloc] initWithEntityName:@"TableShare"];
-}
-
-@dynamic account;
-@dynamic fileName;
-@dynamic serverUrl;
-@dynamic shareLink;
-@dynamic shareUserAndGroup;
-
-@end

+ 12 - 4
iOSClient/Main/CCMain.m

@@ -360,8 +360,11 @@
         [[CCNetworking sharedNetworking] settingAccount];
         
         // populate shared Link & User variable
-        [CCCoreData populateSharesVariableFromDBActiveAccount:app.activeAccount sharesLink:app.sharesLink sharesUserAndGroup:app.sharesUserAndGroup];
-
+        
+        NSArray *share = [[NCManageDatabase sharedInstance] getSharesAccount:app.activeAccount];
+        app.sharesLink = share[0];
+        app.sharesUserAndGroup = share[1];
+        
         // Setting Theming
         [app settingThemingColorBrand];
         
@@ -2898,7 +2901,9 @@
     if([record.account isEqualToString:metadataNet.account] == NO)
         return;
     
-    [CCCoreData updateShare:items sharesLink:app.sharesLink sharesUserAndGroup:app.sharesUserAndGroup activeAccount:app.activeAccount activeUrl:app.activeUrl];
+    NSArray *result = [[NCManageDatabase sharedInstance] updateShare:items account:app.activeAccount activeUrl:app.activeUrl];
+    app.sharesLink = result[0];
+    app.sharesUserAndGroup = result[1];
     
     if (openWindow) {
             
@@ -2965,7 +2970,10 @@
     [_hud hideHud];
     
     // rimuoviamo la condivisione da db
-    [CCCoreData unShare:metadataNet.share fileName:metadataNet.fileName serverUrl:metadataNet.serverUrl sharesLink:app.sharesLink sharesUserAndGroup:app.sharesUserAndGroup activeAccount:app.activeAccount];
+    NSArray *result = [[NCManageDatabase sharedInstance] unShare:metadataNet.share fileName:metadataNet.fileName serverUrl:metadataNet.serverUrl sharesLinkObj:app.sharesLink sharesUserAndGroupObj:app.sharesUserAndGroup account:app.activeAccount];
+    
+    app.sharesLink = result[0];
+    app.sharesUserAndGroup = result[1];
     
     if (_shareOC)
         [_shareOC reloadData];

+ 2 - 1
iOSClient/Settings/CCAdvanced.m

@@ -330,7 +330,8 @@
             
             [CCCoreData flushTableLocalFileAccount:app.activeAccount];
             [CCCoreData flushTableMetadataAccount:app.activeAccount];
-            [CCCoreData flushTableShareAccount:app.activeAccount];
+            
+            [[NCManageDatabase sharedInstance] clearTable:[tableShare class] account:app.activeAccount];
 
             [self emptyUserDirectoryUser:app.activeUser url:app.activeUrl];
             

+ 2 - 1
iOSClient/Settings/CCManageAccount.m

@@ -332,7 +332,8 @@
     [CCCoreData flushTableDirectoryAccount:account];
     [CCCoreData flushTableLocalFileAccount:account];
     [CCCoreData flushTableMetadataAccount:account];
-    [CCCoreData flushTableShareAccount:account];
+    
+    [[NCManageDatabase sharedInstance] clearTable:[tableShare class] account:app.activeAccount];
 }
 
 - (void)answerDelAccount:(XLFormRowDescriptor *)sender

+ 0 - 8
iOSClient/cryptocloud.xcdatamodeld/cryptocloud 9.xcdatamodel/contents

@@ -95,18 +95,10 @@
         <attribute name="typeFile" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="uuid" optional="YES" attributeType="String" syncable="YES"/>
     </entity>
-    <entity name="TableShare" representedClassName="TableShare" syncable="YES">
-        <attribute name="account" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="fileName" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="serverUrl" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="shareLink" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="shareUserAndGroup" optional="YES" attributeType="String" syncable="YES"/>
-    </entity>
     <elements>
         <element name="TableAccount" positionX="-6597" positionY="111" width="171" height="540"/>
         <element name="TableDirectory" positionX="-6372" positionY="111" width="162" height="210"/>
         <element name="TableLocalFile" positionX="-6138" positionY="111" width="162" height="225"/>
         <element name="TableMetadata" positionX="-6138" positionY="402" width="162" height="510"/>
-        <element name="TableShare" positionX="-6597" positionY="558" width="128" height="120"/>
     </elements>
 </model>