Marino Faggiana 8 жил өмнө
parent
commit
90dd3d80a0

+ 1 - 1
iOSClient/Actions/CCActions.swift

@@ -384,7 +384,7 @@ class CCActions: NSObject {
         NSLog("[LOG] Thumbnail Error \(metadataNet.fileName!) \(message) error %\(errorCode))")
         NSLog("[LOG] Thumbnail Error \(metadataNet.fileName!) \(message) error %\(errorCode))")
         
         
         // Activity
         // Activity
-        CCCoreData.addActivityFile(metadataNet.fileID, action: k_activityDebugActionDownloadThumbnail, note: "Selector : \(metadataNet.selector!) Error : \(message)", type: k_activityTypeFailure, verbose: Int(k_activityVerboseHigh), account: appDelegate.activeAccount)
+        CCCoreData.addActivityFile(metadataNet.fileID, action: k_activityDebugActionDownloadThumbnail, selector: metadataNet.selector! , note: "Error : \(message)", type: k_activityTypeFailure, verbose: Int(k_activityVerboseHigh), account: appDelegate.activeAccount)
     }
     }
 
 
     // --------------------------------------------------------------------------------------------
     // --------------------------------------------------------------------------------------------

+ 1 - 1
iOSClient/FileSystem/CCCoreData.h

@@ -211,7 +211,7 @@
 // ===== Activity =====
 // ===== Activity =====
 
 
 + (void)addActivity:(OCActivity *)activity account:(NSString *)account;
 + (void)addActivity:(OCActivity *)activity account:(NSString *)account;
-+ (void)addActivityFile:(NSString *)file action:(NSString *)action note:(NSString *)note type:(NSString *)type verbose:(NSInteger)verbose account:(NSString *)account;
++ (void)addActivityFile:(NSString *)file action:(NSString *)action selector:(NSString *)selector note:(NSString *)note type:(NSString *)type verbose:(NSInteger)verbose account:(NSString *)account;
 + (NSArray *)getAllTableActivityWithPredicate:(NSPredicate *)predicate;
 + (NSArray *)getAllTableActivityWithPredicate:(NSPredicate *)predicate;
 
 
 // ===== File System =====
 // ===== File System =====

+ 2 - 1
iOSClient/FileSystem/CCCoreData.m

@@ -1870,7 +1870,7 @@
     }];
     }];
 }
 }
 
 
-+ (void)addActivityFile:(NSString *)file action:(NSString *)action note:(NSString *)note type:(NSString *)type verbose:(NSInteger)verbose account:(NSString *)account
++ (void)addActivityFile:(NSString *)file action:(NSString *)action selector:(NSString *)selector note:(NSString *)note type:(NSString *)type verbose:(NSInteger)verbose account:(NSString *)account
 {
 {
     [MagicalRecord saveWithBlockAndWait:^(NSManagedObjectContext *localContext) {
     [MagicalRecord saveWithBlockAndWait:^(NSManagedObjectContext *localContext) {
         
         
@@ -1885,6 +1885,7 @@
         record.idActivity = 0;
         record.idActivity = 0;
         record.link = @"";
         record.link = @"";
         record.note = note;
         record.note = note;
+        record.selector = selector;
         record.type = type;
         record.type = type;
         record.verbose = [NSNumber numberWithInteger:verbose];
         record.verbose = [NSNumber numberWithInteger:verbose];
         
         

+ 1 - 0
iOSClient/FileSystem/TableActivity+CoreDataProperties.h

@@ -22,6 +22,7 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nullable, nonatomic, copy) NSNumber *idActivity;
 @property (nullable, nonatomic, copy) NSNumber *idActivity;
 @property (nullable, nonatomic, copy) NSString *link;
 @property (nullable, nonatomic, copy) NSString *link;
 @property (nullable, nonatomic, copy) NSString *note;
 @property (nullable, nonatomic, copy) NSString *note;
+@property (nullable, nonatomic, copy) NSString *selector;
 @property (nullable, nonatomic, copy) NSString *type;
 @property (nullable, nonatomic, copy) NSString *type;
 @property (nullable, nonatomic, copy) NSNumber *verbose;
 @property (nullable, nonatomic, copy) NSNumber *verbose;
 
 

+ 1 - 0
iOSClient/FileSystem/TableActivity+CoreDataProperties.m

@@ -21,6 +21,7 @@
 @dynamic idActivity;
 @dynamic idActivity;
 @dynamic link;
 @dynamic link;
 @dynamic note;
 @dynamic note;
+@dynamic selector;
 @dynamic type;
 @dynamic type;
 @dynamic verbose;
 @dynamic verbose;
 
 

+ 8 - 2
iOSClient/MenuAccount+ControlCenter/CCControlCenterActivity.m

@@ -134,8 +134,12 @@
     noteLabel.numberOfLines = 0;
     noteLabel.numberOfLines = 0;
     [noteLabel setFont:fontSizeNote];
     [noteLabel setFont:fontSizeNote];
     [noteLabel sizeToFit];
     [noteLabel sizeToFit];
-    noteLabel.text = activity.note;
+    
+    if ([activity.verbose integerValue] == k_activityVerboseHigh) noteLabel.text = [NSString stringWithFormat:@"%@ Selector : %@", activity.note, activity.selector];
+    else noteLabel.text = activity.note;
+    
     noteLabel.lineBreakMode = NSLineBreakByWordWrapping;
     noteLabel.lineBreakMode = NSLineBreakByWordWrapping;
+    
     int heighNoteLabel = [self getLabelHeight:noteLabel];
     int heighNoteLabel = [self getLabelHeight:noteLabel];
 
 
     int heightView = 90 + heighNoteLabel + (heighNoteLabel/5);
     int heightView = 90 + heighNoteLabel + (heighNoteLabel/5);
@@ -198,8 +202,10 @@
     noteLabel.textColor = COLOR_TEXT_ANTHRACITE;
     noteLabel.textColor = COLOR_TEXT_ANTHRACITE;
     noteLabel.numberOfLines = 0;
     noteLabel.numberOfLines = 0;
     noteLabel.lineBreakMode = NSLineBreakByWordWrapping;
     noteLabel.lineBreakMode = NSLineBreakByWordWrapping;
-    noteLabel.text = activity.note;
     
     
+    if ([activity.verbose integerValue] == k_activityVerboseHigh) noteLabel.text = [NSString stringWithFormat:@"%@ Selector : %@", activity.note, activity.selector];
+    else noteLabel.text = activity.note;
+
     //headerView.backgroundColor = [UIColor blueColor];
     //headerView.backgroundColor = [UIColor blueColor];
         
         
     return headerView;
     return headerView;

+ 5 - 5
iOSClient/Networking/CCNetworking.m

@@ -382,7 +382,7 @@
     NSString *serverUrl = [self getServerUrlFromUrl:url];
     NSString *serverUrl = [self getServerUrlFromUrl:url];
     
     
     CCMetadata *metadata = [CCCoreData getMetadataWithPreficate:[NSPredicate predicateWithFormat:@"(session = %@) AND ((sessionTaskIdentifier == %i) OR (sessionTaskIdentifierPlist == %i))",session.sessionDescription, task.taskIdentifier, task.taskIdentifier] context:_context];
     CCMetadata *metadata = [CCCoreData getMetadataWithPreficate:[NSPredicate predicateWithFormat:@"(session = %@) AND ((sessionTaskIdentifier == %i) OR (sessionTaskIdentifierPlist == %i))",session.sessionDescription, task.taskIdentifier, task.taskIdentifier] context:_context];
-
+    
     NSInteger errorCode;
     NSInteger errorCode;
     NSString *fileID = metadata.fileID;
     NSString *fileID = metadata.fileID;
     NSString *rev = metadata.rev;
     NSString *rev = metadata.rev;
@@ -424,12 +424,12 @@
             date = [dateFormatter dateFromString:[fields objectForKey:@"Date"]];
             date = [dateFormatter dateFromString:[fields objectForKey:@"Date"]];
 
 
             // Activity
             // Activity
-            [CCCoreData addActivityFile:fileName action:k_activityDebugActionDownload note:[NSString stringWithFormat:@"Server : %@", serverUrl] type:k_activityTypeSuccess verbose:k_activityVerboseDefault account:metadata.account];
+            [CCCoreData addActivityFile:fileName action:k_activityDebugActionDownload selector:metadata.sessionSelector note:serverUrl type:k_activityTypeSuccess verbose:k_activityVerboseDefault account:metadata.account];
             
             
         } else {
         } else {
             
             
             // Activity
             // Activity
-            [CCCoreData addActivityFile:fileName action:k_activityDebugActionDownload note:[NSString stringWithFormat:@"Server : %@ Error : %@", serverUrl, [error localizedDescription]] type:k_activityTypeFailure verbose:k_activityVerboseDefault account:metadata.account];
+            [CCCoreData addActivityFile:fileName action:k_activityDebugActionDownload selector:metadata.sessionSelector note:[NSString stringWithFormat:@"Server : %@ Error : %@", serverUrl, [error localizedDescription]] type:k_activityTypeFailure verbose:k_activityVerboseDefault account:metadata.account];
         }
         }
         
         
         dispatch_async(dispatch_get_main_queue(), ^{
         dispatch_async(dispatch_get_main_queue(), ^{
@@ -457,12 +457,12 @@
             date = [dateFormatter dateFromString:[fields objectForKey:@"Date"]];
             date = [dateFormatter dateFromString:[fields objectForKey:@"Date"]];
             
             
             // Activity
             // Activity
-            [CCCoreData addActivityFile:fileName action:k_activityDebugActionUpload note:[NSString stringWithFormat:@"Server : %@", serverUrl] type:k_activityTypeSuccess verbose:k_activityVerboseDefault account:metadata.account];
+            [CCCoreData addActivityFile:fileName action:k_activityDebugActionUpload selector:metadata.sessionSelector note:serverUrl type:k_activityTypeSuccess verbose:k_activityVerboseDefault account:metadata.account];
 
 
         } else {
         } else {
             
             
             // Activity
             // Activity
-            [CCCoreData addActivityFile:fileName action:k_activityDebugActionUpload note:[NSString stringWithFormat:@"Server : %@ Error : %@", serverUrl, [error localizedDescription]] type:k_activityTypeFailure verbose:k_activityVerboseDefault account:metadata.account];
+            [CCCoreData addActivityFile:fileName action:k_activityDebugActionUpload selector:metadata.sessionSelector note:[NSString stringWithFormat:@"Server : %@ Error : %@", serverUrl, [error localizedDescription]] type:k_activityTypeFailure verbose:k_activityVerboseDefault account:metadata.account];
         }
         }
         
         
         dispatch_async(dispatch_get_main_queue(), ^{
         dispatch_async(dispatch_get_main_queue(), ^{

+ 7 - 7
iOSClient/Networking/OCNetworking.m

@@ -402,7 +402,7 @@
             [[CCCertificate sharedManager] presentViewControllerCertificateWithTitle:[error localizedDescription] viewController:(UIViewController *)self.delegate delegate:self];
             [[CCCertificate sharedManager] presentViewControllerCertificateWithTitle:[error localizedDescription] viewController:(UIViewController *)self.delegate delegate:self];
         
         
         // Activity
         // Activity
-        [CCCoreData addActivityFile:_metadataNet.serverUrl action:k_activityDebugActionReadFolder note:[error.userInfo valueForKey:@"NSLocalizedDescription"] type:k_activityTypeFailure verbose:k_activityVerboseHigh account:_metadataNet.account];
+        [CCCoreData addActivityFile:_metadataNet.serverUrl action:k_activityDebugActionReadFolder selector:@"" note:[error.userInfo valueForKey:@"NSLocalizedDescription"] type:k_activityTypeFailure verbose:k_activityVerboseHigh account:_metadataNet.account];
         
         
         [self complete];
         [self complete];
     }];
     }];
@@ -1169,7 +1169,7 @@
             [[CCCertificate sharedManager] presentViewControllerCertificateWithTitle:[error localizedDescription] viewController:(UIViewController *)self.delegate delegate:self];
             [[CCCertificate sharedManager] presentViewControllerCertificateWithTitle:[error localizedDescription] viewController:(UIViewController *)self.delegate delegate:self];
         
         
         // Activity
         // Activity
-        [CCCoreData addActivityFile:_activeUrl action:k_activityDebugActionGetNotification note:[error.userInfo valueForKey:@"NSLocalizedDescription"] type:k_activityTypeFailure verbose:k_activityVerboseHigh account:_metadataNet.account];
+        [CCCoreData addActivityFile:_activeUrl action:k_activityDebugActionGetNotification selector:@"" note:[error.userInfo valueForKey:@"NSLocalizedDescription"] type:k_activityTypeFailure verbose:k_activityVerboseHigh account:_metadataNet.account];
         
         
         [self complete];
         [self complete];
     }];
     }];
@@ -1233,7 +1233,7 @@
         [communication subscribingPushProxy:k_pushNotificationServer pushToken:pushToken deviceIdentifier:deviceIdentifier deviceIdentifierSignature:signature userPublicKey:devicePublicKey onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSString *publicKey, NSString *deviceIdentifier, NSString *signature, NSString *redirectedServer) {
         [communication subscribingPushProxy:k_pushNotificationServer pushToken:pushToken deviceIdentifier:deviceIdentifier deviceIdentifierSignature:signature userPublicKey:devicePublicKey onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSString *publicKey, NSString *deviceIdentifier, NSString *signature, NSString *redirectedServer) {
             
             
             // Activity
             // Activity
-            [CCCoreData addActivityFile:k_pushNotificationServer action:k_activityDebugActionPushProxy note:@"Service registered." type:k_activityTypeSuccess verbose:k_activityVerboseHigh account:_metadataNet.account];
+            [CCCoreData addActivityFile:k_pushNotificationServer action:k_activityDebugActionPushProxy selector:@"" note:@"Service registered." type:k_activityTypeSuccess verbose:k_activityVerboseHigh account:_metadataNet.account];
             
             
             [self complete];
             [self complete];
             
             
@@ -1248,7 +1248,7 @@
                 [[CCCertificate sharedManager] presentViewControllerCertificateWithTitle:[error localizedDescription] viewController:(UIViewController *)self.delegate delegate:self];
                 [[CCCertificate sharedManager] presentViewControllerCertificateWithTitle:[error localizedDescription] viewController:(UIViewController *)self.delegate delegate:self];
 
 
             // Activity
             // Activity
-            [CCCoreData addActivityFile:k_pushNotificationServer action:k_activityDebugActionPushProxy note:[error.userInfo valueForKey:@"NSLocalizedDescription"] type:k_activityTypeFailure verbose:k_activityVerboseHigh account:_metadataNet.account];
+            [CCCoreData addActivityFile:k_pushNotificationServer action:k_activityDebugActionPushProxy selector:@"" note:[error.userInfo valueForKey:@"NSLocalizedDescription"] type:k_activityTypeFailure verbose:k_activityVerboseHigh account:_metadataNet.account];
 
 
             [self complete];
             [self complete];
         }];
         }];
@@ -1264,7 +1264,7 @@
             [[CCCertificate sharedManager] presentViewControllerCertificateWithTitle:[error localizedDescription] viewController:(UIViewController *)self.delegate delegate:self];
             [[CCCertificate sharedManager] presentViewControllerCertificateWithTitle:[error localizedDescription] viewController:(UIViewController *)self.delegate delegate:self];
         
         
         // Activity
         // Activity
-        [CCCoreData addActivityFile:_activeUrl action:k_activityDebugActionServerPush note:[error.userInfo valueForKey:@"NSLocalizedDescription"] type:k_activityTypeFailure verbose:k_activityVerboseHigh account:_metadataNet.account];
+        [CCCoreData addActivityFile:_activeUrl action:k_activityDebugActionServerPush selector:@"" note:[error.userInfo valueForKey:@"NSLocalizedDescription"] type:k_activityTypeFailure verbose:k_activityVerboseHigh account:_metadataNet.account];
 
 
         [self complete];
         [self complete];
     }];
     }];
@@ -1371,7 +1371,7 @@
             [[CCCertificate sharedManager] presentViewControllerCertificateWithTitle:[error localizedDescription] viewController:(UIViewController *)self.delegate delegate:self];
             [[CCCertificate sharedManager] presentViewControllerCertificateWithTitle:[error localizedDescription] viewController:(UIViewController *)self.delegate delegate:self];
         
         
         // Activity
         // Activity
-        [CCCoreData addActivityFile:_activeUrl action:k_activityDebugActionFeatures note:[error.userInfo valueForKey:@"NSLocalizedDescription"] type:k_activityTypeFailure verbose:k_activityVerboseHigh account:_metadataNet.account];
+        [CCCoreData addActivityFile:_activeUrl action:k_activityDebugActionFeatures selector:@"" note:[error.userInfo valueForKey:@"NSLocalizedDescription"] type:k_activityTypeFailure verbose:k_activityVerboseHigh account:_metadataNet.account];
 
 
         [self complete];
         [self complete];
     }];
     }];
@@ -1407,7 +1407,7 @@
             [[CCCertificate sharedManager] presentViewControllerCertificateWithTitle:[error localizedDescription] viewController:(UIViewController *)self.delegate delegate:self];
             [[CCCertificate sharedManager] presentViewControllerCertificateWithTitle:[error localizedDescription] viewController:(UIViewController *)self.delegate delegate:self];
 
 
         // Activity
         // Activity
-        [CCCoreData addActivityFile:_activeUrl action:k_activityDebugActionCapabilities note:[error.userInfo valueForKey:@"NSLocalizedDescription"] type:k_activityTypeFailure verbose:k_activityVerboseHigh account:_metadataNet.account];
+        [CCCoreData addActivityFile:_activeUrl action:k_activityDebugActionCapabilities selector:@"" note:[error.userInfo valueForKey:@"NSLocalizedDescription"] type:k_activityTypeFailure verbose:k_activityVerboseHigh account:_metadataNet.account];
         
         
         [self complete];
         [self complete];
     }];
     }];

+ 4 - 4
iOSClient/PhotosCameraUpload/CCPhotosCameraUpload.m

@@ -1105,7 +1105,7 @@
         return;
         return;
     
     
     // Activity
     // Activity
-    [CCCoreData addActivityFile:@"" action:k_activityDebugActionAutomaticUpload note:[NSString stringWithFormat:@"Number : %lu", [newItemsToUpload count]] type:k_activityTypeInfo verbose:k_activityVerboseHigh account:app.activeAccount];
+    [CCCoreData addActivityFile:@"" action:k_activityDebugActionAutomaticUpload selector:@"" note:[NSString stringWithFormat:@"Number : %lu", [newItemsToUpload count]] type:k_activityTypeInfo verbose:k_activityVerboseHigh account:app.activeAccount];
     
     
     // STOP new request : initStateCameraUpload
     // STOP new request : initStateCameraUpload
     //_AutomaticCameraUploadInProgress = YES;
     //_AutomaticCameraUploadInProgress = YES;
@@ -1168,7 +1168,7 @@
         //_AutomaticCameraUploadInProgress = NO;
         //_AutomaticCameraUploadInProgress = NO;
         
         
         // Activity
         // Activity
-        [CCCoreData addActivityFile:@"" action:k_activityDebugActionAutomaticUpload note:description type:k_activityTypeFailure verbose:k_activityVerboseDefault account:app.activeAccount];
+        [CCCoreData addActivityFile:@"" action:k_activityDebugActionAutomaticUpload selector:@"" note:description type:k_activityTypeFailure verbose:k_activityVerboseDefault account:app.activeAccount];
         
         
         return;
         return;
     }
     }
@@ -1186,7 +1186,7 @@
                     [app messageNotification:@"_error_" description:@"_error_createsubfolders_upload_" visible:YES delay:k_dismissAfterSecond type:TWMessageBarMessageTypeInfo];
                     [app messageNotification:@"_error_" description:@"_error_createsubfolders_upload_" visible:YES delay:k_dismissAfterSecond type:TWMessageBarMessageTypeInfo];
                 
                 
                 // Activity
                 // Activity
-                [CCCoreData addActivityFile:@"" action:k_activityDebugActionAutomaticUpload note:NSLocalizedString(@"_error_createsubfolders_upload_",nil) type:k_activityTypeFailure verbose:k_activityVerboseDefault account:app.activeAccount];
+                [CCCoreData addActivityFile:@"" action:k_activityDebugActionAutomaticUpload selector:@"" note:NSLocalizedString(@"_error_createsubfolders_upload_",nil) type:k_activityTypeFailure verbose:k_activityVerboseDefault account:app.activeAccount];
                 
                 
                 return;
                 return;
             }
             }
@@ -1245,7 +1245,7 @@
         NSString *media = @"";
         NSString *media = @"";
         if (assetMediaType == PHAssetMediaTypeImage) media = @"Image";
         if (assetMediaType == PHAssetMediaTypeImage) media = @"Image";
         if (assetMediaType == PHAssetMediaTypeVideo) media = @"Video";
         if (assetMediaType == PHAssetMediaTypeVideo) media = @"Video";
-        [CCCoreData addActivityFile:fileName action:k_activityDebugActionAutomaticUpload note:[NSString stringWithFormat:@"Add TableAutomaticUpload on Session : %@, Set Data asset %@", session, media] type:k_activityTypeInfo verbose:k_activityVerboseHigh account:app.activeAccount];
+        [CCCoreData addActivityFile:fileName action:k_activityDebugActionAutomaticUpload selector:@"" note:[NSString stringWithFormat:@"Add TableAutomaticUpload on Session : %@, Set Data asset %@", session, media] type:k_activityTypeInfo verbose:k_activityVerboseHigh account:app.activeAccount];
         
         
         // Upldate Camera Upload data  
         // Upldate Camera Upload data  
         if ([metadataNet.selector isEqualToString:selectorUploadAutomatic])
         if ([metadataNet.selector isEqualToString:selectorUploadAutomatic])

+ 2 - 1
iOSClient/cryptocloud.xcdatamodeld/cryptocloud 7.xcdatamodel/contents

@@ -46,6 +46,7 @@
         <attribute name="idActivity" optional="YES" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="NO" syncable="YES"/>
         <attribute name="idActivity" optional="YES" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="NO" syncable="YES"/>
         <attribute name="link" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="link" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="note" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="note" optional="YES" attributeType="String" syncable="YES"/>
+        <attribute name="selector" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="type" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="type" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="verbose" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="NO" syncable="YES"/>
         <attribute name="verbose" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="NO" syncable="YES"/>
     </entity>
     </entity>
@@ -142,7 +143,7 @@
     </entity>
     </entity>
     <elements>
     <elements>
         <element name="TableAccount" positionX="-6597" positionY="111" width="171" height="585"/>
         <element name="TableAccount" positionX="-6597" positionY="111" width="171" height="585"/>
-        <element name="TableActivity" positionX="-6399" positionY="252" width="128" height="180"/>
+        <element name="TableActivity" positionX="-6399" positionY="252" width="128" height="195"/>
         <element name="TableAutomaticUpload" positionX="-6597" positionY="801" width="128" height="180"/>
         <element name="TableAutomaticUpload" positionX="-6597" positionY="801" width="128" height="180"/>
         <element name="TableCertificates" positionX="-6597" positionY="711" width="128" height="60"/>
         <element name="TableCertificates" positionX="-6597" positionY="711" width="128" height="60"/>
         <element name="TableDirectory" positionX="-6372" positionY="111" width="162" height="210"/>
         <element name="TableDirectory" positionX="-6372" positionY="111" width="162" height="210"/>