Browse Source

activity protocol

Marino Faggiana 8 years ago
parent
commit
85e73e5a2f

+ 1 - 1
Libraries external/OCCommunicationLib/OCCommunicationLib/OCActivity.h

@@ -32,7 +32,7 @@
 @property (nonatomic, strong) NSString *message;
 @property (nonatomic, strong) NSString *session;
 @property (nonatomic, strong) NSString *subject;
-@property NSInteger type;
+@property (nonatomic, strong) NSString *type;
 @property NSInteger verbose;
 
 @end

+ 1 - 1
Libraries external/OCCommunicationLib/OCCommunicationLib/OCActivity.m

@@ -37,7 +37,7 @@
         self.message = @"";
         self.session = @"";
         self.subject = @"";
-        self.type = 0;
+        self.type = @"";
         self.verbose = 0;
     }
     

+ 1 - 1
iOSClient/FileSystem/CCCoreData.h

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

+ 2 - 2
iOSClient/FileSystem/CCCoreData.m

@@ -1869,7 +1869,7 @@
     }];
 }
 
-+ (void)addActivityFile:(NSString *)file subject:(NSString *)subject message:(NSString *)message session:(NSString *)session type:(NSInteger)type verbose:(NSInteger)verbose account:(NSString *)account
++ (void)addActivityFile:(NSString *)file subject:(NSString *)subject message:(NSString *)message session:(NSString *)session type:(NSString *)type verbose:(NSInteger)verbose account:(NSString *)account
 {
     [MagicalRecord saveWithBlockAndWait:^(NSManagedObjectContext *localContext) {
         
@@ -1882,7 +1882,7 @@
         record.message = message;
         record.session = session;
         record.subject = subject;
-        record.type = [NSNumber numberWithInteger:type];
+        record.type = type;
         record.verbose = [NSNumber numberWithInteger:verbose];
    }];
 }

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

@@ -23,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nullable, nonatomic, copy) NSString *message;
 @property (nullable, nonatomic, copy) NSString *session;
 @property (nullable, nonatomic, copy) NSString *subject;
-@property (nullable, nonatomic, copy) NSNumber *type;
+@property (nullable, nonatomic, copy) NSString *type;
 @property (nullable, nonatomic, copy) NSNumber *verbose;
 
 @end

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

@@ -156,8 +156,8 @@
     dataLabel.textColor = [UIColor colorWithRed:130.0/255.0 green:130.0/255.0 blue:130.0/255.0 alpha:1.0];
     dataLabel.text =  [CCUtility getTitleSectionDate:date];
     [dataLabel setFont:fontSizeData];
-        
-    if (activity.type == 0)
+    
+    if ([activity.type length] == 0 || [activity.type isEqualToString:k_activityTypeInfo])
         typeImage.image = [UIImage imageNamed:image_user];
         
     subjectLabel.textColor = COLOR_TEXT_ANTHRACITE;

+ 1 - 1
iOSClient/Networking/OCNetworking.m

@@ -166,7 +166,7 @@
 #pragma mark ===== Activity LOG =====
 #pragma --------------------------------------------------------------------------------------------
 
-- (void)createActivityType:(NSInteger)type Verbose:(NSInteger)verbose
+- (void)createActivityType:(NSString *)type Verbose:(NSInteger)verbose
 {
     [CCCoreData addActivityFile:_fileActivityLog subject:[NSString stringWithFormat:@"%@ : %@",_metadataNet.selector, _subjectActivityLog] message:_metadataNet.action session:[CCUtility createRandomString:16] type:type verbose:verbose account:_metadataNet.account];
 }

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

@@ -47,7 +47,7 @@
         <attribute name="message" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="session" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="subject" optional="YES" attributeType="String" syncable="YES"/>
-        <attribute name="type" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="NO" 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"/>
     </entity>
     <entity name="TableAutomaticUpload" representedClassName="TableAutomaticUpload" syncable="YES">