소스 검색

Add session on activity

Marino Faggiana 8 년 전
부모
커밋
8ba67535a4

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

@@ -30,6 +30,7 @@
 @property (nonatomic, strong) NSString *file;
 @property (nonatomic, strong) NSString *link;
 @property (nonatomic, strong) NSString *message;
+@property (nonatomic, strong) NSString *session;
 @property (nonatomic, strong) NSString *subject;
 @property (nonatomic, strong) NSString *type;
 @property NSInteger verbose;

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

@@ -35,6 +35,7 @@
         self.file = @"";
         self.link = @"";
         self.message = @"";
+        self.session = @"";
         self.subject = @"";
         self.type = @"";
         self.verbose = 0;

+ 19 - 0
iOSClient/FileSystem/CCCoreData.m

@@ -1866,10 +1866,29 @@
         record.link = activity.link;
         record.message = activity.message;
         record.subject = activity.subject;
+        record.type = activity.type;
         record.verbose = [NSNumber numberWithInteger:activity.verbose];
     }];
 }
 
++ (void)addActivityFile:(NSString *)file subject:(NSString *)subject type:(NSString *)type verbose:(NSInteger)verbose account:(NSString *)account
+{
+    [MagicalRecord saveWithBlockAndWait:^(NSManagedObjectContext *localContext) {
+        
+        TableActivity *record = [TableActivity MR_createEntityInContext:localContext];
+        
+        record.account = account;
+        record.idActivity = 0;
+        record.date = [NSDate date];
+        record.file = file;
+        record.subject = subject;
+        record.type = type;
+        record.verbose = [NSNumber numberWithInteger:verbose];
+
+        
+   }];
+}
+
 + (NSArray *)getAllTableActivityWithPredicate:(NSPredicate *)predicate
 {
     NSManagedObjectContext *context = [NSManagedObjectContext MR_defaultContext];

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

@@ -21,6 +21,7 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nullable, nonatomic, copy) NSString *file;
 @property (nullable, nonatomic, copy) NSString *link;
 @property (nullable, nonatomic, copy) NSString *message;
+@property (nullable, nonatomic, copy) NSString *session;
 @property (nullable, nonatomic, copy) NSString *subject;
 @property (nullable, nonatomic, copy) NSString *type;
 @property (nullable, nonatomic, copy) NSNumber *verbose;

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

@@ -20,6 +20,7 @@
 @dynamic file;
 @dynamic link;
 @dynamic message;
+@dynamic session;
 @dynamic subject;
 @dynamic type;
 @dynamic verbose;

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

@@ -45,6 +45,7 @@
         <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="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="String" syncable="YES"/>
         <attribute name="verbose" optional="YES" attributeType="Integer 16" defaultValueString="0" usesScalarValueType="NO" syncable="YES"/>
@@ -142,7 +143,7 @@
     </entity>
     <elements>
         <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="TableCertificates" positionX="-6597" positionY="711" width="128" height="60"/>
         <element name="TableDirectory" positionX="-6372" positionY="111" width="162" height="210"/>