Marino Faggiana 6 سال پیش
والد
کامیت
f812e5a69a

+ 1 - 1
iOSClient/Brand/File_Provider_Extension.plist

@@ -19,7 +19,7 @@
 	<key>CFBundleShortVersionString</key>
 	<string>2.22.5</string>
 	<key>CFBundleVersion</key>
-	<string>1</string>
+	<string>2</string>
 	<key>NSExtension</key>
 	<dict>
 		<key>NSExtensionFileProviderDocumentGroup</key>

+ 1 - 1
iOSClient/Brand/Notification_Service_Extension.plist

@@ -19,7 +19,7 @@
 	<key>CFBundleShortVersionString</key>
 	<string>2.22.5</string>
 	<key>CFBundleVersion</key>
-	<string>1</string>
+	<string>2</string>
 	<key>NSExtension</key>
 	<dict>
 		<key>NSExtensionPointIdentifier</key>

+ 1 - 1
iOSClient/Brand/Share.plist

@@ -19,7 +19,7 @@
 	<key>CFBundleShortVersionString</key>
 	<string>2.22.5</string>
 	<key>CFBundleVersion</key>
-	<string>1</string>
+	<string>2</string>
 	<key>NSAppTransportSecurity</key>
 	<dict>
 		<key>NSAllowsArbitraryLoads</key>

+ 1 - 1
iOSClient/Brand/iOSClient.plist

@@ -69,7 +69,7 @@
 		</dict>
 	</array>
 	<key>CFBundleVersion</key>
-	<string>1</string>
+	<string>2</string>
 	<key>FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED</key>
 	<true/>
 	<key>Fabric</key>

+ 3 - 0
iOSClient/CCGlobal.h

@@ -292,6 +292,9 @@
 // Flow Version
 #define k_flow_version_available                        12
 
+// Trash Version
+#define k_trash_version_available                       14
+
 // Cell Reload Data Source
 #define k_action_NULL                                   0
 #define k_action_MOD                                    1

+ 1 - 5
iOSClient/Library/OCCommunicationLib/OCCommunication.m

@@ -2825,11 +2825,7 @@
     
     [request listTrashbinPath:path user:_user userID:_userID onCommunication:sharedOCCommunication withUserSessionToken:token success:^(NSHTTPURLResponse *response, id responseObject, NSString *token) {
         
-        NSData *responseData = (NSData*) responseObject;
-        
-        //            NSString* newStr = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
-        //            NSLog(@"newStrReadFolder: %@", newStr);
-        
+        NSData *responseData = (NSData *)responseObject;
         OCXMLParser *parser = [[OCXMLParser alloc]init];
         [parser initParserWithData:responseData];
         NSMutableArray *directoryList = [parser.directoryList mutableCopy];

+ 3 - 1
iOSClient/Library/OCCommunicationLib/OCFileDto.h

@@ -48,6 +48,8 @@
 @property (nonatomic, copy) NSString *ocId;
 @property BOOL isFavorite;
 @property BOOL isEncrypted;
-
+@property (nonatomic, copy) NSString *trashbinFileName;
+@property (nonatomic, copy) NSString *trashbinOriginalLocation;
+@property long trashbinDeletionTime;
 
 @end

+ 20 - 1
iOSClient/Library/OCCommunicationLib/OCWebDavClient/OCWebDAVClient.m

@@ -1218,7 +1218,26 @@ NSString const *OCWebDAVModificationDateKey	= @"modificationdate";
 
     NSMutableURLRequest *request = [self requestWithMethod:_requestMethod path:[NSString stringWithFormat:@"%@/trashbin/%@/trash", path, userID] parameters:nil timeout:k_timeout_webdav];
     
-    [request setHTTPBody:[@"<?xml version=\"1.0\" encoding=\"UTF-8\"?><D:propfind xmlns:D=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\" xmlns:nc=\"http://nextcloud.org/ns\"><D:prop><D:resourcetype/><D:getlastmodified/><size xmlns=\"http://owncloud.org/ns\"/><favorite xmlns=\"http://owncloud.org/ns\"/><id xmlns=\"http://owncloud.org/ns\"/><D:getcontentlength/><D:getetag/><permissions xmlns=\"http://owncloud.org/ns\"/><D:getcontenttype/><nc:is-encrypted/></D:prop></D:propfind>" dataUsingEncoding:NSUTF8StringEncoding]];
+    NSString *body = [NSString stringWithFormat: @""
+                      "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+                      "<D:propfind xmlns:D=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\" xmlns:nc=\"http://nextcloud.org/ns\">"
+                      "<D:prop>"
+                      "<D:resourcetype/>"
+                      "<D:getlastmodified/>"
+                      "<oc:size/>"
+                      "<oc:favorite/>"
+                      "<oc:fileid/>"
+                      "<D:getcontentlength/>"
+                      "<D:getetag/>"
+                      "<oc:permissions/>"
+                      "<nc:is-encrypted/>"
+                      "<nc:trashbin-filename/>"
+                      "<nc:trashbin-original-location/>"
+                      "<nc:trashbin-deletion-time/>"
+                      "</D:prop>"
+                      "</D:propfind>"];
+
+    [request setHTTPBody:[body dataUsingEncoding:NSUTF8StringEncoding]];
     [request setValue:@"application/xml" forHTTPHeaderField:@"Content-Type"];
     
     OCHTTPRequestOperation *operation = [self mr_operationWithRequest:request onCommunication:sharedOCCommunication withUserSessionToken:token success:success failure:failure];

+ 6 - 0
iOSClient/Library/OCCommunicationLib/OCWebDavClient/Parsers/OCXMLListParser.m

@@ -195,6 +195,12 @@
         _currentFile.isFavorite = [_xmlChars boolValue];
     } else if ([elementName isEqualToString:@"nc:is-encrypted"]) {
         _currentFile.isEncrypted = [_xmlChars boolValue];
+    } else if ([elementName isEqualToString:@"nc:trashbin-filename"]) {
+        _currentFile.trashbinFileName = _xmlChars;
+    }else if ([elementName isEqualToString:@"nc:trashbin-original-location"]) {
+        _currentFile.trashbinOriginalLocation = _xmlChars;
+    }else if ([elementName isEqualToString:@"nc:trashbin-deletion-time"]) {
+        _currentFile.trashbinDeletionTime = (long)[_xmlChars longLongValue];
     }
 }
 

+ 6 - 0
iOSClient/Library/OCCommunicationLib/OCWebDavClient/Parsers/OCXMLParser.m

@@ -239,6 +239,12 @@ NSString *OCCWebDAVURIKey           = @"uri";
         _currentFile.permissions = _xmlChars;
     } else if ([elementName isEqualToString:@"nc:is-encrypted"]) {
         _currentFile.isEncrypted = [_xmlChars boolValue];
+    }else if ([elementName isEqualToString:@"nc:trashbin-filename"]) {
+        _currentFile.trashbinFileName = _xmlChars;
+    }else if ([elementName isEqualToString:@"nc:trashbin-original-location"]) {
+        _currentFile.trashbinOriginalLocation = _xmlChars;
+    }else if ([elementName isEqualToString:@"nc:trashbin-deletion-time"]) {
+        _currentFile.trashbinDeletionTime = (long)[_xmlChars longLongValue];
     }
 }
 

+ 10 - 7
iOSClient/Main/CCMore.swift

@@ -124,14 +124,17 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource, CCLo
         }
         
         // ITEM : Trash
-        item = OCExternalSites.init()
-        item.name = "_trash_"
-        item.icon = "trash"
-        item.url = "segueTrash"
-        functionMenu.append(item)
-
-        // ITEM : External
+        let capabilities = NCManageDatabase.sharedInstance.getCapabilites()
+        if capabilities != nil && capabilities!.versionMajor >= Int(k_trash_version_available) {
+            
+            item = OCExternalSites.init()
+            item.name = "_trash_"
+            item.icon = "trash"
+            item.url = "segueTrash"
+            functionMenu.append(item)
+        }
         
+        // ITEM : External
         if NCBrandOptions.sharedInstance.disable_more_external_site == false {
         
             listExternalSite = NCManageDatabase.sharedInstance.getAllExternalSites()