Marino Faggiana hace 6 años
padre
commit
53700e7922

+ 0 - 6
Nextcloud.xcodeproj/project.pbxproj

@@ -394,7 +394,6 @@
 		F79A65C32191D90F00FF6DCC /* NCSelect.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F79A65C22191D90F00FF6DCC /* NCSelect.storyboard */; };
 		F79A65C62191D95E00FF6DCC /* NCSelect.swift in Sources */ = {isa = PBXBuildFile; fileRef = F79A65C52191D95E00FF6DCC /* NCSelect.swift */; };
 		F7A321551E9E2A070069AD1B /* CCFavorites.m in Sources */ = {isa = PBXBuildFile; fileRef = F7A3214F1E9E2A070069AD1B /* CCFavorites.m */; };
-		F7A321651E9E37960069AD1B /* CCActivity.m in Sources */ = {isa = PBXBuildFile; fileRef = F7A321641E9E37960069AD1B /* CCActivity.m */; };
 		F7A3218C1E9E42B30069AD1B /* CCMenuAccount.m in Sources */ = {isa = PBXBuildFile; fileRef = F7A3218B1E9E42B30069AD1B /* CCMenuAccount.m */; };
 		F7A321AD1E9E6AD50069AD1B /* CCAdvanced.m in Sources */ = {isa = PBXBuildFile; fileRef = F7A321AC1E9E6AD50069AD1B /* CCAdvanced.m */; };
 		F7A377161EB2364A002856D3 /* Crashlytics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F7A377141EB2364A002856D3 /* Crashlytics.framework */; };
@@ -1130,8 +1129,6 @@
 		F79A65C52191D95E00FF6DCC /* NCSelect.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCSelect.swift; sourceTree = "<group>"; };
 		F7A3214E1E9E2A070069AD1B /* CCFavorites.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCFavorites.h; sourceTree = "<group>"; };
 		F7A3214F1E9E2A070069AD1B /* CCFavorites.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CCFavorites.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
-		F7A321631E9E37960069AD1B /* CCActivity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCActivity.h; sourceTree = "<group>"; };
-		F7A321641E9E37960069AD1B /* CCActivity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = CCActivity.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
 		F7A3218A1E9E42B30069AD1B /* CCMenuAccount.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMenuAccount.h; sourceTree = "<group>"; };
 		F7A3218B1E9E42B30069AD1B /* CCMenuAccount.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCMenuAccount.m; sourceTree = "<group>"; };
 		F7A321AB1E9E6AD50069AD1B /* CCAdvanced.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCAdvanced.h; sourceTree = "<group>"; };
@@ -2329,8 +2326,6 @@
 			children = (
 				F7C9555221F0C4CA0024296E /* NCActivity.storyboard */,
 				F7C9555421F0C5470024296E /* NCActivity.swift */,
-				F7A321631E9E37960069AD1B /* CCActivity.h */,
-				F7A321641E9E37960069AD1B /* CCActivity.m */,
 			);
 			path = Activity;
 			sourceTree = "<group>";
@@ -3551,7 +3546,6 @@
 				F7F54D0C1E5B14C800E19C62 /* MWTapDetectingView.m in Sources */,
 				F7B1FBC61E72E3D1001781FE /* SwiftModalWebVC.swift in Sources */,
 				F7A5541F204EF8AF008468EC /* TOScrollBar.m in Sources */,
-				F7A321651E9E37960069AD1B /* CCActivity.m in Sources */,
 				F7FB1D3E215E191D00D669EA /* NCViewerDocumentWeb.swift in Sources */,
 				F78E7065219F096B006F23E4 /* NCAvatar.swift in Sources */,
 				F7DFB7F0219C5B8000680748 /* NCCreateFormUploadAssets.swift in Sources */,

+ 0 - 37
iOSClient/Activity/CCActivity.h

@@ -1,37 +0,0 @@
-//
-//  CCActivity.h
-//  Nextcloud iOS
-//
-//  Created by Marino Faggiana on 12/04/17.
-//  Copyright (c) 2017 Marino Faggiana. All rights reserved.
-//
-//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import <Foundation/Foundation.h>
-#import <DZNEmptyDataSet/DZNEmptyDataSet.h>
-
-@interface CCActivity : UICollectionViewController <UICollectionViewDataSource, UICollectionViewDelegate, DZNEmptyDataSetSource, DZNEmptyDataSetDelegate>
-
-@property NSUInteger pageIndex;
-
-@property (nonatomic, strong) NSDate *storeDateFirstActivity;
-@property (nonatomic, strong) NSString *pageType;
-
-- (void)reloadDatasource;
-+ (CGFloat)getLabelHeight:(UILabel*)label width:(int)width;
-
-@end

+ 0 - 411
iOSClient/Activity/CCActivity.m

@@ -1,411 +0,0 @@
-//
-//  CCActivity.m
-//  Nextcloud iOS
-//
-//  Created by Marino Faggiana on 12/04/17.
-//  Copyright (c) 2017 Marino Faggiana. All rights reserved.
-//
-//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import "CCActivity.h"
-#import "AppDelegate.h"
-#import "CCSection.h"
-#import "NCBridgeSwift.h"
-
-#define fontSizeData    [UIFont boldSystemFontOfSize:15]
-#define fontSizeAction  [UIFont systemFontOfSize:14]
-#define fontSizeNote    [UIFont systemFontOfSize:14]
-
-@interface CCActivity ()
-{
-    AppDelegate *appDelegate;
-    BOOL _verbose;
-
-    // Datasource
-    NSArray *_sectionDataSource;
-}
-@end
-
-@implementation CCActivity
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Init =====
-#pragma --------------------------------------------------------------------------------------------
-
--  (id)initWithCoder:(NSCoder *)aDecoder
-{
-    if (self = [super initWithCoder:aDecoder])  {
-        
-        appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
-
-        appDelegate.activeActivity = self;
-        
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeTheming) name:@"changeTheming" object:nil];
-    }
-    return self;
-}
-
-- (void)viewDidLoad
-{
-    [super viewDidLoad];
- 
-    self.collectionView.emptyDataSetSource = self;
-    self.collectionView.emptyDataSetDelegate = self;
-    self.collectionView.delegate = self;
-    
-    _verbose = [CCUtility getActivityVerboseHigh];
-    
-    _sectionDataSource = [NSArray new];
-    
-    self.title = NSLocalizedString(@"_activity_", nil);
-
-    [self reloadDatasource];
-}
-
-// Apparirà
-- (void)viewWillAppear:(BOOL)animated
-{
-    [super viewWillAppear:animated];
-    
-    _verbose = [CCUtility getActivityVerboseHigh];
-    
-    // Color
-    [appDelegate aspectNavigationControllerBar:self.navigationController.navigationBar online:[appDelegate.reachability isReachable] hidden:NO];
-    [appDelegate aspectTabBar:self.tabBarController.tabBar hidden:NO];
-    
-    // Plus Button
-    [appDelegate plusButtonVisibile:true];
-}
-
-// E' arrivato
-- (void)viewDidAppear:(BOOL)animated
-{
-    [super viewDidAppear:animated];
-    
-    [self getActivity];
-}
-
-- (void)changeTheming
-{
-    if (self.isViewLoaded && self.view.window)
-        [appDelegate changeTheming:self];
-}
-
-- (void)didReceiveMemoryWarning {
-    
-    [super didReceiveMemoryWarning];
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ==== DZNEmptyDataSetSource ====
-#pragma --------------------------------------------------------------------------------------------
-
-- (BOOL)emptyDataSetShouldDisplay:(UIScrollView *)scrollView
-{
-    if([_sectionDataSource count] > 0)
-        return NO;
-    else
-        return YES;
-}
-
-- (UIColor *)backgroundColorForEmptyDataSet:(UIScrollView *)scrollView
-{
-    return [NCBrandColor sharedInstance].backgroundView;
-}
-
-- (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView
-{
-    return [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"activityNoRecord"] multiplier:1 color:[NCBrandColor sharedInstance].graySoft];
-}
-
-- (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView
-{
-    NSString *text = [NSString stringWithFormat:@"%@", NSLocalizedString(@"_no_activity_", nil)];
-
-    NSDictionary *attributes = @{NSFontAttributeName:[UIFont boldSystemFontOfSize:20.0f], NSForegroundColorAttributeName:[UIColor lightGrayColor]};
-    
-    return [[NSAttributedString alloc] initWithString:text attributes:attributes];
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark - ==== Datasource ====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)getActivity
-{
-    [[OCNetworking sharedManager] getActivityWithAccount:appDelegate.activeAccount completion:^(NSString *account, NSArray *listOfActivity, NSString *message, NSInteger errorCode) {
-        if (errorCode == 0 && [account isEqualToString:appDelegate.activeAccount]) {
-            [[NCManageDatabase sharedInstance] addActivityServer:listOfActivity account:account];
-        } else if (errorCode == kOCErrorServerUnauthorized) {
-            [appDelegate openLoginView:self delegate:appDelegate.activeMain loginType:k_login_Modify_Password selector:k_intro_login];
-        } else if (errorCode == NSURLErrorServerCertificateUntrusted) {
-            [[CCCertificate sharedManager] presentViewControllerCertificateWithTitle:message viewController:self delegate:self];
-        } else if (errorCode != 0) {
-            [appDelegate messageNotification:@"_error_" description:message visible:YES delay:k_dismissAfterSecond type:TWMessageBarMessageTypeError errorCode:errorCode];
-        } else {
-            NSLog(@"[LOG] It has been changed user during networking process, error.");
-        }
-        [self reloadDatasource];
-    }];
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark - ==== Datasource ====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)reloadDatasource
-{
-    // test
-    if (appDelegate.activeAccount.length == 0)
-        return;
-    
-    NSPredicate *predicate;
-        
-    NSDate *sixDaysAgo = [[NSCalendar currentCalendar] dateByAddingUnit:NSCalendarUnitDay value:-k_daysOfActivity toDate:[NSDate date] options:0];
-        
-    if (_verbose)
-        predicate = [NSPredicate predicateWithFormat:@"account == %@ AND date > %@", appDelegate.activeAccount, sixDaysAgo];
-    else
-        predicate = [NSPredicate predicateWithFormat:@"account == %@ AND verbose == %lu AND date > %@", appDelegate.activeAccount, k_activityVerboseDefault, sixDaysAgo];
-
-    _sectionDataSource = [[NCManageDatabase sharedInstance] getActivityWithPredicate:predicate];
-        
-    [self reloadCollection];
-    
-}
-
-- (void)reloadCollection
-{
-    NSDate *dateActivity;
-    
-    if ([_sectionDataSource count] > 0)
-        dateActivity = ((tableActivity *)[_sectionDataSource objectAtIndex:0]).date;
-
-    if ([dateActivity compare:_storeDateFirstActivity] == NSOrderedDescending || _storeDateFirstActivity == nil || dateActivity == nil) {
-        _storeDateFirstActivity = dateActivity;
-        [self.collectionView reloadData];
-    }    
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark - ==== Table ====
-#pragma --------------------------------------------------------------------------------------------
-
-- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView
-{
-    return [_sectionDataSource count];
-}
-
-- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
-{
-    tableActivity *activity = [_sectionDataSource objectAtIndex:section];
-    
-    if (activity.fileID.length > 0) {
-     
-        tableMetadata *metadata = [[NCManageDatabase sharedInstance] getMetadataWithPredicate:[NSPredicate predicateWithFormat:@"fileID == %@", activity.fileID]];
-        
-        if (metadata && ([activity.action isEqual: k_activityDebugActionDownload] || [activity.action isEqual: k_activityDebugActionUpload])) {
-            
-            if ([[NSFileManager defaultManager] fileExistsAtPath:[CCUtility getDirectoryProviderStorageIconFileID:metadata.fileID fileNameView:metadata.fileNameView]]) {
-                return 1;
-            } else {
-                return 0;
-            }
-        }
-    }
-    
-    return 0;
-}
-
--(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section
-{
-    tableActivity *activity = [_sectionDataSource objectAtIndex:section];
-    
-    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, collectionView.frame.size.width - 40, CGFLOAT_MAX)];
-    label.numberOfLines = 0;
-    label.lineBreakMode = NSLineBreakByWordWrapping;
-    [label sizeToFit];
-    
-    // Action
-    [label setFont:fontSizeAction];
-    label.text = [NSString stringWithFormat:@"%@ %@", activity.action, activity.file];
-    int heightAction = [[self class] getLabelHeight:label width:self.collectionView.frame.size.width];
-    
-    // Note
-    [label setFont:fontSizeNote];
-    
-    if (_verbose && activity.idActivity == 0 && [activity.selector length] > 0)
-        label.text = [NSString stringWithFormat:@"%@ Selector: %@", activity.note, activity.selector];
-    else
-        label.text = activity.note;
-    
-    int heightNote = [[self class] getLabelHeight:label width:self.collectionView.frame.size.width];
-    
-    int heightView = 40 + heightAction + heightNote + 17;
-    
-    return CGSizeMake(collectionView.frame.size.width, heightView);
-}
-
-- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
-{
-    UICollectionReusableView *reusableview;
-    
-    if (kind == UICollectionElementKindSectionHeader) {
-    
-        reusableview = [collectionView dequeueReusableSupplementaryViewOfKind:kind withReuseIdentifier:@"header" forIndexPath:indexPath];
-        
-        tableActivity *activity = [_sectionDataSource objectAtIndex:indexPath.section];
-    
-        UILabel *dateLabel = (UILabel *)[reusableview viewWithTag:100];
-        UILabel *actionLabel = (UILabel *)[reusableview viewWithTag:101];
-        UILabel *noteLabel = (UILabel *)[reusableview viewWithTag:102];
-        UIImageView *typeImage = (UIImageView *) [reusableview viewWithTag:103];
-    
-        [dateLabel setFont:fontSizeData];
-        dateLabel.textColor = [UIColor colorWithRed:100.0/255.0 green:100.0/255.0 blue:100.0/255.0 alpha:1.0];
-    
-        if (_verbose) {
-        
-            dateLabel.text = [NSDateFormatter localizedStringFromDate:activity.date dateStyle:NSDateFormatterFullStyle timeStyle:NSDateFormatterMediumStyle];
-        
-        } else {
-        
-            NSDateComponents* comps = [[NSCalendar currentCalendar] components:NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay fromDate:activity.date];
-            dateLabel.text = [CCUtility getTitleSectionDate:[[NSCalendar currentCalendar] dateFromComponents:comps]];
-        }
-    
-        [actionLabel setFont:fontSizeAction];
-        [actionLabel sizeToFit];
-        actionLabel.text = [NSString stringWithFormat:@"%@ %@", activity.action, activity.file];
-
-        if ([activity.type isEqualToString:k_activityTypeInfo]) {
-        
-            actionLabel.textColor = [NCBrandColor sharedInstance].nextcloud;
-        
-            if (activity.idActivity == 0)
-                typeImage.image = [UIImage imageNamed:@"activityTypeInfo"];
-            else
-                typeImage.image = [UIImage imageNamed:@"activityTypeInfoServer"];
-        }
-    
-        if ([activity.type isEqualToString:k_activityTypeSuccess]) {
-        
-            actionLabel.textColor = [UIColor colorWithRed:87.0/255.0 green:187.0/255.0 blue:57.0/255.0 alpha:1.0];;
-            typeImage.image = [UIImage imageNamed:@"activityTypeSuccess"];
-        }
-    
-        if ([activity.type isEqualToString:k_activityTypeFailure]) {
-        
-            actionLabel.textColor = [UIColor redColor];
-            typeImage.image = [UIImage imageNamed:@"activityTypeFailure"];
-        }
-    
-        [noteLabel setFont:fontSizeNote];
-        [noteLabel sizeToFit];
-        noteLabel.textColor = [UIColor blackColor];
-        noteLabel.numberOfLines = 0;
-        noteLabel.lineBreakMode = NSLineBreakByWordWrapping;
-    
-        if (_verbose && activity.idActivity == 0 && [activity.selector length] > 0)
-            noteLabel.text = [NSString stringWithFormat:@"%@ Selector: %@", activity.note, activity.selector];
-        else
-            noteLabel.text = activity.note;
-    }
-    
-    if (kind == UICollectionElementKindSectionFooter) {
-        
-         reusableview = [collectionView dequeueReusableSupplementaryViewOfKind:kind withReuseIdentifier:@"footer" forIndexPath:indexPath];
-    }
-    
-    return reusableview;
-}
-
-- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
-{
-    UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath];
-    //cell.backgroundColor = [UIColor clearColor];
-    UIImageView *imageView = (UIImageView *)[cell viewWithTag:104];
-
-    tableActivity *activity = [_sectionDataSource objectAtIndex:indexPath.section];
-    
-    if (activity.fileID.length > 0) {
-        
-        tableMetadata *metadata = [[NCManageDatabase sharedInstance] getMetadataWithPredicate:[NSPredicate predicateWithFormat:@"fileID == %@", activity.fileID]];
-        
-        if (metadata && ([activity.action isEqual: k_activityDebugActionDownload] || [activity.action isEqual: k_activityDebugActionUpload])) {
-            
-             if ([[NSFileManager defaultManager] fileExistsAtPath:[CCUtility getDirectoryProviderStorageIconFileID:metadata.fileID fileNameView:metadata.fileNameView]]) {
-             
-                 imageView.image = [UIImage imageWithContentsOfFile:[CCUtility getDirectoryProviderStorageIconFileID:metadata.fileID fileNameView:metadata.fileNameView]];
-                 
-             } else {
-                 
-                 imageView.image = [UIImage imageNamed:metadata.iconName];
-             }
-        }
-    } else {
-        
-        imageView.image = [UIImage imageNamed:@"file"];
-    }
-    
-    return cell;
-}
-
-- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
-{
-    tableActivity *activity = [_sectionDataSource objectAtIndex:indexPath.section];
-    tableMetadata *metadata = [[NCManageDatabase sharedInstance] getMetadataWithPredicate:[NSPredicate predicateWithFormat:@"fileID == %@", activity.fileID]];
-    
-    BOOL existsFile = [CCUtility fileProviderStorageExists:metadata.fileID fileNameView:metadata.fileNameView];
-    
-    if (metadata && existsFile) {
-        
-        if (!self.splitViewController.isCollapsed && appDelegate.activeMain.detailViewController.isViewLoaded && appDelegate.activeMain.detailViewController.view.window)
-            [appDelegate.activeMain.navigationController popToRootViewControllerAnimated:NO];
-        
-        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
-            
-            [appDelegate.activeMain performSegueWithIdentifier:@"segueDetail" sender:metadata];
-        });
-        
-    } else {
-        
-        [appDelegate messageNotification:@"_info_" description:@"_activity_file_not_present_" visible:YES delay:k_dismissAfterSecond type:TWMessageBarMessageTypeInfo errorCode:0];
-    }
-}
-
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark - ==== Utility ====
-#pragma --------------------------------------------------------------------------------------------
-
-+ (CGFloat)getLabelHeight:(UILabel*)label width:(int)width
-{
-    CGSize constraint = CGSizeMake(width, CGFLOAT_MAX);
-    
-    NSMutableParagraphStyle *paragraph = [NSMutableParagraphStyle new];
-    paragraph.lineBreakMode = NSLineBreakByWordWrapping;
-    NSDictionary *attributes = @{NSFontAttributeName : label.font, NSParagraphStyleAttributeName: paragraph};
-    
-    NSStringDrawingContext *context = [NSStringDrawingContext new];
-    CGSize boundingBox = [label.text boundingRectWithSize:constraint options:NSStringDrawingUsesLineFragmentOrigin attributes:attributes context:context].size;
-    
-    CGSize size = CGSizeMake(ceil(boundingBox.width), ceil(boundingBox.height));
-    
-    return size.height;
-}
-
-@end

+ 0 - 2
iOSClient/AppDelegate.h

@@ -30,7 +30,6 @@
 #import "TWMessageBarManager.h"
 #import "CCBKPasscode.h"
 #import "CCUtility.h"
-#import "CCActivity.h"
 #import "CCDetail.h"
 #import "CCMain.h"
 #import "CCMedia.h"
@@ -116,7 +115,6 @@
 @property (nonatomic, strong) CCMedia *activeMedia;
 @property (nonatomic, retain) CCDetail *activeDetail;
 @property (nonatomic, retain) CCSettings *activeSettings;
-@property (nonatomic, retain) CCActivity *activeActivity;
 @property (nonatomic, retain) CCTransfers *activeTransfers;
 @property (nonatomic, retain) CCLogin *activeLogin;
 @property (nonatomic, retain) CCLoginWeb *activeLoginWeb;

+ 12 - 3
iOSClient/Database/NCDatabase.swift

@@ -64,13 +64,22 @@ class tableActivity: Object {
     @objc dynamic var account = ""
     @objc dynamic var action = "Activity"
     @objc dynamic var date = NSDate()
-    @objc dynamic var file = ""
-    @objc dynamic var fileID = ""
     @objc dynamic var idActivity: Double = 0
+    @objc dynamic var app = ""
+    @objc dynamic var type = ""
+    @objc dynamic var user = ""
+    @objc dynamic var subject = ""
+    let subject_rich = List<String>()
+    @objc dynamic var message = ""
+    let message_rich = List<String>()
+    @objc dynamic var icon = ""
     @objc dynamic var link = ""
+    @objc dynamic var object_type = ""
+    @objc dynamic var object_id: Double = 0
+    @objc dynamic var object_name = ""
+    let previews = List<String>()
     @objc dynamic var note = ""
     @objc dynamic var selector = ""
-    @objc dynamic var type = ""
     @objc dynamic var verbose: Bool = false
 }
 

+ 5 - 2
iOSClient/Database/NCManageDatabase.swift

@@ -57,7 +57,7 @@ class NCManageDatabase: NSObject {
         let config = Realm.Configuration(
         
             fileURL: dirGroup?.appendingPathComponent("\(k_appDatabaseNextcloud)/\(k_databaseDefault)"),
-            schemaVersion: 39,
+            schemaVersion: 40,
             
             // 10 : Version 2.18.0
             // 11 : Version 2.18.2
@@ -88,7 +88,8 @@ class NCManageDatabase: NSObject {
             // 36 : Version 2.22.8.14
             // 37 : Version 2.22.8.14
             // 38 : Version 2.22.8.20
-            // 39 : Version 2.22.9.3
+            // 39 : Version 2.22.9.1
+            // 40 : Version 2.22.9.3
 
             migrationBlock: { migration, oldSchemaVersion in
                 // We haven’t migrated anything yet, so oldSchemaVersion == 0
@@ -603,6 +604,7 @@ class NCManageDatabase: NSObject {
     
     @objc func addActivityClient(_ file: String, fileID: String, action: String, selector: String, note: String, type: String, verbose: Bool, activeUrl: String?) {
 
+        /*
         guard let tableAccount = self.getAccountActive() else {
             return
         }
@@ -646,6 +648,7 @@ class NCManageDatabase: NSObject {
         }
         
         print("[LOG] " + note)
+        */
     }
     
     //MARK: -

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

@@ -1937,7 +1937,6 @@
                     
                     [listOfActivity addObject:activity];
                 }
-                
                 successRequest(response, listOfActivity, request.redirectedServer);
 
             } else {

+ 3 - 3
iOSClient/Networking/NCService.swift

@@ -233,9 +233,9 @@ class NCService: NSObject {
                     OCNetworking.sharedManager().getActivityWithAccount(account!, completion: { (account, listOfActivity, message, errorCode) in
                         if errorCode == 0 && account == self.appDelegate.activeAccount {
                             NCManageDatabase.sharedInstance.addActivityServer(listOfActivity as! [OCActivity], account: account!)
-                            if (self.appDelegate.activeActivity != nil) {
-                                self.appDelegate.activeActivity.reloadDatasource()
-                            }
+                            //if (self.appDelegate.activeActivity != nil) {
+                            //    self.appDelegate.activeActivity.reloadDatasource()
+                            //}
                         } else if errorCode != 0 {
                             var error = ""
                             if let message = message {

+ 3 - 3
iOSClient/Settings/CCAdvanced.m

@@ -184,7 +184,7 @@
         [CCUtility setActivityVerboseHigh:[[rowDescriptor.value valueData] boolValue]];
         
         // Clear Date read Activity for force reload datasource
-        appDelegate.activeActivity.storeDateFirstActivity = nil;
+        //appDelegate.activeActivity.storeDateFirstActivity = nil;
     }
     
     if ([rowDescriptor.tag isEqualToString:@"showHiddenFiles"]) {
@@ -267,7 +267,7 @@
         if ([activity.type isEqual: k_activityTypeSuccess]) type = @"Success";
         if ([activity.type isEqual: k_activityTypeFailure]) type = @"Failure";
         
-        actionFile = [[NSString stringWithFormat:@"%@ %@", activity.action, activity.file] stringByPaddingToLength:100 withString:@" " startingAtIndex:0];
+        actionFile = [[NSString stringWithFormat:@"%@ %@", activity.action, activity.app] stringByPaddingToLength:100 withString:@" " startingAtIndex:0];
         
         if (activity.idActivity == 0) note = [NSString stringWithFormat:@"%@ Selector: %@", activity.note, activity.selector];
         else note = activity.note;
@@ -315,7 +315,7 @@
     
     [[NCManageDatabase sharedInstance] clearTable:[tableActivity class] account:appDelegate.activeAccount];
         
-    [appDelegate.activeActivity reloadDatasource];
+    //[appDelegate.activeActivity reloadDatasource];
 }
 
 #pragma --------------------------------------------------------------------------------------------