CCMove.m 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543
  1. //
  2. // CCMove.m
  3. // Nextcloud iOS
  4. //
  5. // Created by Marino Faggiana on 04/09/14.
  6. // Copyright (c) 2017 Marino Faggiana. All rights reserved.
  7. //
  8. // Author Marino Faggiana <marino.faggiana@nextcloud.com>
  9. //
  10. // This program is free software: you can redistribute it and/or modify
  11. // it under the terms of the GNU General Public License as published by
  12. // the Free Software Foundation, either version 3 of the License, or
  13. // (at your option) any later version.
  14. //
  15. // This program is distributed in the hope that it will be useful,
  16. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. // GNU General Public License for more details.
  19. //
  20. // You should have received a copy of the GNU General Public License
  21. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  22. //
  23. #import "CCMove.h"
  24. #import "NCBridgeSwift.h"
  25. @interface CCMove ()
  26. {
  27. NSString *activeAccount;
  28. NSString *activePassword;
  29. NSString *activeUrl;
  30. NSString *activeUser;
  31. NSString *activeUserID;
  32. BOOL _loadingFolder;
  33. // Automatic Upload Folder
  34. NSString *_autoUploadFileName;
  35. NSString *_autoUploadDirectory;
  36. NSPredicate *predicateDataSource;
  37. }
  38. @end
  39. @implementation CCMove
  40. // MARK: - View
  41. - (void)viewDidLoad
  42. {
  43. [super viewDidLoad];
  44. tableAccount *recordAccount = [[NCManageDatabase sharedInstance] getAccountActive];
  45. if (recordAccount) {
  46. activeAccount = recordAccount.account;
  47. activePassword = recordAccount.password;
  48. activeUrl = recordAccount.url;
  49. activeUser = recordAccount.user;
  50. activeUserID = recordAccount.userID;
  51. } else {
  52. UIAlertController * alert= [UIAlertController alertControllerWithTitle:nil message:NSLocalizedString(@"_no_active_account_", nil) preferredStyle:UIAlertControllerStyleAlert];
  53. UIAlertAction* ok = [UIAlertAction actionWithTitle:NSLocalizedString(@"_ok_", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
  54. [alert dismissViewControllerAnimated:YES completion:nil];
  55. }];
  56. [alert addAction:ok];
  57. [self presentViewController:alert animated:YES completion:nil];
  58. }
  59. [self.cancel setTitle:NSLocalizedString(@"_cancel_", nil)];
  60. [self.create setTitle:NSLocalizedString(@"_create_folder_", nil)];
  61. if (![_serverUrl length]) {
  62. UIImageView *image;
  63. _serverUrl = [CCUtility getHomeServerUrlActiveUrl:activeUrl];
  64. tableCapabilities *capabilities = [[NCManageDatabase sharedInstance] getCapabilites];
  65. if ([capabilities.themingColor isEqualToString:@"#FFFFFF"])
  66. image = [[UIImageView alloc] initWithImage:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"themingLogo"] multiplier:2 color:[UIColor blackColor]]];
  67. else
  68. image = [[UIImageView alloc] initWithImage:[CCGraphics changeThemingColorImage:[UIImage imageNamed:@"themingLogo"] multiplier:2 color:[UIColor whiteColor]]];
  69. [self.navigationController.navigationBar.topItem setTitleView:image];
  70. self.title = @"Home";
  71. } else {
  72. UILabel* label = [[UILabel alloc] initWithFrame:CGRectMake(0,0, self.navigationItem.titleView.frame.size.width, 40)];
  73. label.text = self.passMetadata.fileNameView;
  74. label.textColor = NCBrandColor.sharedInstance.brandText;
  75. label.backgroundColor =[UIColor clearColor];
  76. label.textAlignment = NSTextAlignmentCenter;
  77. self.navigationItem.titleView=label;
  78. }
  79. // TableView : at the end of rows nothing
  80. self.tableView.tableFooterView = [UIView new];
  81. self.tableView.separatorColor = NCBrandColor.sharedInstance.seperator;
  82. self.tableView.emptyDataSetDelegate = self;
  83. self.tableView.emptyDataSetSource = self;
  84. // get auto upload folder
  85. _autoUploadFileName = [[NCManageDatabase sharedInstance] getAccountAutoUploadFileName];
  86. _autoUploadDirectory = [[NCManageDatabase sharedInstance] getAccountAutoUploadDirectory:activeUrl];
  87. // read file->folder
  88. [self readFile];
  89. }
  90. // Apparirà
  91. - (void)viewWillAppear:(BOOL)animated
  92. {
  93. [super viewWillAppear:animated];
  94. self.navigationController.navigationBar.barTintColor = NCBrandColor.sharedInstance.brand;
  95. self.navigationController.navigationBar.tintColor = NCBrandColor.sharedInstance.brandText;
  96. self.navigationController.toolbar.barTintColor = NCBrandColor.sharedInstance.tabBar;
  97. self.navigationController.toolbar.tintColor = NCBrandColor.sharedInstance.brandElement;
  98. if (self.hideCreateFolder) {
  99. [self.create setEnabled:NO];
  100. [self.create setTintColor: [UIColor clearColor]];
  101. }
  102. if (self.hideMoveutton) {
  103. [self.move setEnabled:NO];
  104. [self.move setTintColor: [UIColor clearColor]];
  105. }
  106. }
  107. #pragma --------------------------------------------------------------------------------------------
  108. #pragma mark ==== DZNEmptyDataSetSource ====
  109. #pragma --------------------------------------------------------------------------------------------
  110. - (BOOL)emptyDataSetShouldDisplay:(UIScrollView *)scrollView
  111. {
  112. if (_loadingFolder)
  113. return YES;
  114. else
  115. return NO;
  116. }
  117. - (BOOL)emptyDataSetShouldAllowScroll:(UIScrollView *)scrollView
  118. {
  119. return NO;
  120. }
  121. - (UIColor *)backgroundColorForEmptyDataSet:(UIScrollView *)scrollView
  122. {
  123. return [UIColor whiteColor];
  124. }
  125. - (UIView *)customViewForEmptyDataSet:(UIScrollView *)scrollView
  126. {
  127. if (_loadingFolder) {
  128. UIActivityIndicatorView *activityView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
  129. activityView.transform = CGAffineTransformMakeScale(1.5f, 1.5f);
  130. activityView.color = [NCBrandColor sharedInstance].brandElement;
  131. [activityView startAnimating];
  132. return activityView;
  133. }
  134. return nil;
  135. }
  136. // MARK: - IBAction
  137. - (IBAction)cancel:(UIBarButtonItem *)sender
  138. {
  139. if ([self.delegate respondsToSelector:@selector(dismissMove)])
  140. [self.delegate dismissMove];
  141. [self dismissViewControllerAnimated:YES completion:nil];
  142. }
  143. - (IBAction)move:(UIBarButtonItem *)sender
  144. {
  145. [_networkingOperationQueue cancelAllOperations];
  146. if ([self.delegate respondsToSelector:@selector(dismissMove)])
  147. [self.delegate dismissMove];
  148. [self.delegate moveServerUrlTo:_serverUrl title:self.passMetadata.fileNameView type:self.type];
  149. [self dismissViewControllerAnimated:YES completion:nil];
  150. }
  151. - (IBAction)create:(UIBarButtonItem *)sender
  152. {
  153. UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"_create_folder_",nil) message:@"" preferredStyle:UIAlertControllerStyleAlert];
  154. [alertController addTextFieldWithConfigurationHandler:^(UITextField *textField) {
  155. //textField.placeholder = NSLocalizedString(@"LoginPlaceholder", @"Login");
  156. textField.autocapitalizationType = UITextAutocapitalizationTypeWords;
  157. }];
  158. [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_save_", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
  159. [self createFolder:alertController.textFields.firstObject.text];
  160. }]];
  161. [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_cancel_", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
  162. }]];
  163. [self presentViewController:alertController animated:YES completion:nil];
  164. }
  165. // MARK: - BKPasscodeViewController
  166. - (void)passcodeViewController:(CCBKPasscode *)aViewController didFinishWithPasscode:(NSString *)aPasscode
  167. {
  168. [aViewController dismissViewControllerAnimated:YES completion:nil];
  169. [self performSegueDirectoryWithControlPasscode:false];
  170. }
  171. - (void)passcodeViewController:(BKPasscodeViewController *)aViewController authenticatePasscode:(NSString *)aPasscode resultHandler:(void (^)(BOOL))aResultHandler
  172. {
  173. if ([aPasscode isEqualToString:[CCUtility getBlockCode]]) {
  174. self.lockUntilDate = nil;
  175. self.failedAttempts = 0;
  176. aResultHandler(YES);
  177. } else {
  178. aResultHandler(NO);
  179. }
  180. }
  181. - (void)passcodeViewControllerDidFailAttempt:(BKPasscodeViewController *)aViewController
  182. {
  183. self.failedAttempts++;
  184. if (self.failedAttempts > 5) {
  185. NSTimeInterval timeInterval = 60;
  186. if (self.failedAttempts > 6) {
  187. NSUInteger multiplier = self.failedAttempts - 6;
  188. timeInterval = (5 * 60) * multiplier;
  189. if (timeInterval > 3600 * 24) {
  190. timeInterval = 3600 * 24;
  191. }
  192. }
  193. self.lockUntilDate = [NSDate dateWithTimeIntervalSinceNow:timeInterval];
  194. }
  195. }
  196. - (NSUInteger)passcodeViewControllerNumberOfFailedAttempts:(BKPasscodeViewController *)aViewController
  197. {
  198. return self.failedAttempts;
  199. }
  200. - (NSDate *)passcodeViewControllerLockUntilDate:(BKPasscodeViewController *)aViewController
  201. {
  202. return self.lockUntilDate;
  203. }
  204. - (void)passcodeViewCloseButtonPressed:(id)sender
  205. {
  206. [self dismissViewControllerAnimated:YES completion:nil];
  207. }
  208. // MARK: - Read File
  209. - (void)readFile
  210. {
  211. OCnetworking *ocNetworking = [[OCnetworking alloc] initWithDelegate:nil metadataNet:nil withUser:activeUser withUserID:activeUserID withPassword:activePassword withUrl:activeUrl];
  212. [ocNetworking readFile:nil serverUrl:_serverUrl account:activeAccount success:^(tableMetadata *metadata) {
  213. tableDirectory *directory = [[NCManageDatabase sharedInstance] getTableDirectoryWithPredicate:[NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@", activeAccount, _serverUrl]];
  214. if ([metadata.etag isEqualToString:directory.etag] == NO) {
  215. [self readFolder];
  216. }
  217. } failure:^(NSString *message, NSInteger errorCode) {
  218. [self readFolder];
  219. }];
  220. }
  221. // MARK: - Read Folder
  222. - (void)readFolder
  223. {
  224. OCnetworking *ocNetworking = [[OCnetworking alloc] initWithDelegate:nil metadataNet:nil withUser:activeUser withUserID:activeUserID withPassword:activePassword withUrl:activeUrl];
  225. [ocNetworking readFolder:_serverUrl depth:@"1" account:activeAccount success:^(NSArray *metadatas, tableMetadata *metadataFolder, NSString *directoryID) {
  226. // Update directory etag
  227. [[NCManageDatabase sharedInstance] setDirectoryWithServerUrl:_serverUrl serverUrlTo:nil etag:metadataFolder.etag fileID:metadataFolder.fileID encrypted:metadataFolder.e2eEncrypted];
  228. [[NCManageDatabase sharedInstance] deleteMetadataWithPredicate:[NSPredicate predicateWithFormat:@"directoryID == %@ AND (status == %d OR status == %d)", directoryID, k_metadataStatusNormal, k_metadataStatusHide] clearDateReadDirectoryID:directoryID];
  229. [[NCManageDatabase sharedInstance] setDateReadDirectoryWithDirectoryID:directoryID];
  230. NSArray *metadatasInDownload = [[NCManageDatabase sharedInstance] getMetadatasWithPredicate:[NSPredicate predicateWithFormat:@"directoryID == %@ AND (status == %d OR status == %d OR status == %d OR status == %d)", directoryID, k_metadataStatusWaitDownload, k_metadataStatusInDownload, k_metadataStatusDownloading, k_metadataStatusDownloadError] sorted:nil ascending:NO];
  231. // insert in Database
  232. (void)[[NCManageDatabase sharedInstance] addMetadatas:metadatas serverUrl:_serverUrl];
  233. // reinsert metadatas in Download
  234. if (metadatasInDownload) {
  235. (void)[[NCManageDatabase sharedInstance] addMetadatas:metadatasInDownload serverUrl:_serverUrl];
  236. }
  237. _loadingFolder = NO;
  238. [self.tableView reloadData];
  239. } failure:^(NSString *message, NSInteger errorCode) {
  240. _loadingFolder = NO;
  241. self.move.enabled = NO;
  242. [self.tableView reloadData];
  243. UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"_error_",nil) message:message preferredStyle:UIAlertControllerStyleAlert];
  244. [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_ok_", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
  245. }]];
  246. [self presentViewController:alertController animated:YES completion:nil];
  247. }];
  248. _loadingFolder = YES;
  249. [self.tableView reloadData];
  250. }
  251. // MARK: - Create Folder
  252. - (void)createFolder:(NSString *)fileNameFolder
  253. {
  254. OCnetworking *ocNetworking = [[OCnetworking alloc] initWithDelegate:nil metadataNet:nil withUser:activeUser withUserID:activeUserID withPassword:activePassword withUrl:activeUrl];
  255. [ocNetworking createFolder:fileNameFolder serverUrl:_serverUrl account:activeAccount success:^(NSString *fileID, NSDate *date) {
  256. [self readFolder];
  257. } failure:^(NSString *message, NSInteger errorCode) {
  258. UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"_error_",nil) message:message preferredStyle:UIAlertControllerStyleAlert];
  259. [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_ok_", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
  260. }]];
  261. [self presentViewController:alertController animated:YES completion:nil];
  262. }];
  263. }
  264. // MARK: - Table
  265. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
  266. {
  267. return 1;
  268. }
  269. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  270. {
  271. NSString *directoryID = [[NCManageDatabase sharedInstance] getDirectoryID:_serverUrl];
  272. if (!directoryID) return 0;
  273. if (self.includeDirectoryE2EEncryption) {
  274. if (self.includeImages) {
  275. predicateDataSource = [NSPredicate predicateWithFormat:@"directoryID == %@ AND (directory == true OR typeFile == 'image')", directoryID];
  276. } else {
  277. predicateDataSource = [NSPredicate predicateWithFormat:@"directoryID == %@ AND directory == true", directoryID];
  278. }
  279. } else {
  280. if (self.includeImages) {
  281. predicateDataSource = [NSPredicate predicateWithFormat:@"directoryID == %@ AND e2eEncrypted == false AND (directory == true OR typeFile == 'image')", directoryID];
  282. } else {
  283. predicateDataSource = [NSPredicate predicateWithFormat:@"directoryID == %@ AND e2eEncrypted == false AND directory == true", directoryID];
  284. }
  285. }
  286. NSArray *result = [[NCManageDatabase sharedInstance] getMetadatasWithPredicate:predicateDataSource sorted:nil ascending:NO];
  287. if (result)
  288. return [result count];
  289. else
  290. return 0;
  291. }
  292. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  293. {
  294. static NSString *CellIdentifier = @"MyCustomCell";
  295. UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  296. if (cell == nil) {
  297. cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
  298. }
  299. tableMetadata *metadata = [[NCManageDatabase sharedInstance] getMetadataAtIndexWithPredicate:predicateDataSource sorted:@"fileName" ascending:YES index:indexPath.row];
  300. // Create Directory Provider Storage FileID
  301. [CCUtility getDirectoryProviderStorageFileID:metadata.fileID];
  302. // colors
  303. cell.textLabel.textColor = [UIColor blackColor];
  304. cell.detailTextLabel.text = @"";
  305. if (metadata.directory) {
  306. if (metadata.e2eEncrypted)
  307. cell.imageView.image = [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"folderEncrypted"] multiplier:2 color:[NCBrandColor sharedInstance].brandElement];
  308. else if ([metadata.fileName isEqualToString:_autoUploadFileName] && [self.serverUrl isEqualToString:_autoUploadDirectory])
  309. cell.imageView.image = [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"folderAutomaticUpload"] multiplier:2 color:[NCBrandColor sharedInstance].brandElement];
  310. else
  311. cell.imageView.image = [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"folder"] multiplier:2 color:[NCBrandColor sharedInstance].brandElement];
  312. } else {
  313. UIImage *thumb = [UIImage imageWithContentsOfFile:[CCUtility getDirectoryProviderStorageIconFileID:metadata.fileID fileNameView:metadata.fileNameView]];
  314. if (thumb) {
  315. cell.imageView.image = thumb;
  316. } else {
  317. if (metadata.iconName.length > 0) {
  318. cell.imageView.image = [UIImage imageNamed:metadata.iconName];
  319. } else {
  320. cell.imageView.image = [UIImage imageNamed:@"file"];
  321. }
  322. }
  323. }
  324. cell.textLabel.text = metadata.fileNameView;
  325. cell.accessoryType = UITableViewCellAccessoryNone;
  326. return cell;
  327. }
  328. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  329. {
  330. tableMetadata *metadata = [[NCManageDatabase sharedInstance] getMetadataAtIndexWithPredicate:predicateDataSource sorted:@"fileName" ascending:YES index:indexPath.row];
  331. if (metadata.directory) {
  332. [self performSegueDirectoryWithControlPasscode:YES];
  333. } else {
  334. if (self.selectFile) {
  335. if ([self.delegate respondsToSelector:@selector(dismissMove)])
  336. [self.delegate dismissMove];
  337. if ([self.delegate respondsToSelector:@selector(selectMetadata:serverUrl:)])
  338. [self.delegate selectMetadata:metadata serverUrl:_serverUrl];
  339. [self dismissViewControllerAnimated:YES completion:nil];
  340. }
  341. }
  342. }
  343. // MARK: - Navigation
  344. - (void)performSegueDirectoryWithControlPasscode:(BOOL)controlPasscode
  345. {
  346. NSString *nomeDir;
  347. NSIndexPath *index = [self.tableView indexPathForSelectedRow];
  348. NSString *directoryID = [[NCManageDatabase sharedInstance] getDirectoryID:_serverUrl];
  349. if (!directoryID) return;
  350. tableMetadata *metadata = [[NCManageDatabase sharedInstance] getMetadataAtIndexWithPredicate:predicateDataSource sorted:@"fileName" ascending:YES index:index.row];
  351. // lockServerUrl
  352. NSString *lockServerUrl = [CCUtility stringAppendServerUrl:_serverUrl addFileName:metadata.fileName];
  353. // Se siamo in presenza di una directory bloccata E è attivo il block E la sessione PASSWORD Lock è senza data ALLORA chiediamo la password per procedere
  354. tableDirectory *directory = [[NCManageDatabase sharedInstance] getTableDirectoryWithPredicate:[NSPredicate predicateWithFormat:@"account == %@ AND serverUrl == %@", activeAccount, lockServerUrl]];
  355. if (directory.lock && [[CCUtility getBlockCode] length] && controlPasscode) {
  356. CCBKPasscode *viewController = [[CCBKPasscode alloc] initWithNibName:nil bundle:nil];
  357. viewController.delegate = self;
  358. //viewController.fromType = CCBKPasscodeFromLockDirectory;
  359. viewController.type = BKPasscodeViewControllerCheckPasscodeType;
  360. viewController.inputViewTitlePassword = YES;
  361. if ([CCUtility getSimplyBlockCode]) {
  362. viewController.passcodeStyle = BKPasscodeInputViewNumericPasscodeStyle;
  363. viewController.passcodeInputView.maximumLength = 6;
  364. } else {
  365. viewController.passcodeStyle = BKPasscodeInputViewNormalPasscodeStyle;
  366. viewController.passcodeInputView.maximumLength = 64;
  367. }
  368. BKTouchIDManager *touchIDManager = [[BKTouchIDManager alloc] initWithKeychainServiceName:k_serviceShareKeyChain];
  369. touchIDManager.promptText = NSLocalizedString(@"_scan_fingerprint_", nil);
  370. viewController.touchIDManager = touchIDManager;
  371. viewController.title = NSLocalizedString(@"_folder_blocked_", nil);
  372. viewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(passcodeViewCloseButtonPressed:)];
  373. viewController.navigationItem.leftBarButtonItem.tintColor = [UIColor blackColor];
  374. UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:viewController];
  375. [self presentViewController:navController animated:YES completion:nil];
  376. return;
  377. }
  378. nomeDir = metadata.fileName;
  379. CCMove *viewController = [[UIStoryboard storyboardWithName:@"CCMove" bundle:nil] instantiateViewControllerWithIdentifier:@"CCMoveVC"];
  380. viewController.delegate = self.delegate;
  381. viewController.includeDirectoryE2EEncryption = self.includeDirectoryE2EEncryption;
  382. viewController.includeImages = self.includeImages;
  383. viewController.move.title = self.move.title;
  384. viewController.hideCreateFolder = self.hideCreateFolder;
  385. viewController.hideMoveutton = self.hideMoveutton;
  386. viewController.selectFile = self.selectFile;
  387. viewController.type = self.type;
  388. viewController.networkingOperationQueue = self.networkingOperationQueue;
  389. viewController.passMetadata = metadata;
  390. viewController.serverUrl = [CCUtility stringAppendServerUrl:_serverUrl addFileName:nomeDir];
  391. [self.navigationController pushViewController:viewController animated:YES];
  392. }
  393. @end