|
@@ -1870,7 +1870,7 @@
|
|
|
#pragma mark ===== Shared =====
|
|
|
#pragma --------------------------------------------------------------------------------------------
|
|
|
|
|
|
-- (void)readShareWithAccount:(NSString *)account openWindow:(BOOL)openWindow metadata:(tableMetadata *)metadata
|
|
|
+- (void)readShareWithAccount:(NSString *)account metadata:(tableMetadata *)metadata
|
|
|
{
|
|
|
[[OCNetworking sharedManager] readShareWithAccount:account path:@"/" completion:^(NSString *account, NSArray *items, NSString *message, NSInteger errorCode) {
|
|
|
|
|
@@ -1892,27 +1892,24 @@
|
|
|
// Notify Shares View
|
|
|
[[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:@"SharesReloadDatasource" object:nil userInfo:nil];
|
|
|
|
|
|
- if (openWindow) {
|
|
|
-
|
|
|
- if (_shareOC) {
|
|
|
-
|
|
|
- [_shareOC reloadData];
|
|
|
-
|
|
|
- } else if (metadata) {
|
|
|
-
|
|
|
- // Apriamo la view
|
|
|
- _shareOC = [[UIStoryboard storyboardWithName:@"CCShare" bundle:nil] instantiateViewControllerWithIdentifier:@"CCShareOC"];
|
|
|
+ if (_shareOC) {
|
|
|
|
|
|
- _shareOC.delegate = self;
|
|
|
- _shareOC.metadata = metadata;
|
|
|
- _shareOC.serverUrl = metadata.serverUrl;
|
|
|
-
|
|
|
- _shareOC.shareLink = [appDelegate.sharesLink objectForKey:metadata.fileID];
|
|
|
- _shareOC.shareUserAndGroup = [appDelegate.sharesUserAndGroup objectForKey:metadata.fileID];
|
|
|
-
|
|
|
- [_shareOC setModalPresentationStyle:UIModalPresentationFormSheet];
|
|
|
- [self presentViewController:_shareOC animated:YES completion:nil];
|
|
|
- }
|
|
|
+ [_shareOC reloadData];
|
|
|
+
|
|
|
+ } else if (metadata) {
|
|
|
+
|
|
|
+ // Apriamo la view
|
|
|
+ _shareOC = [[UIStoryboard storyboardWithName:@"CCShare" bundle:nil] instantiateViewControllerWithIdentifier:@"CCShareOC"];
|
|
|
+
|
|
|
+ _shareOC.delegate = self;
|
|
|
+ _shareOC.metadata = metadata;
|
|
|
+ _shareOC.serverUrl = metadata.serverUrl;
|
|
|
+
|
|
|
+ _shareOC.shareLink = [appDelegate.sharesLink objectForKey:metadata.fileID];
|
|
|
+ _shareOC.shareUserAndGroup = [appDelegate.sharesUserAndGroup objectForKey:metadata.fileID];
|
|
|
+
|
|
|
+ [_shareOC setModalPresentationStyle:UIModalPresentationFormSheet];
|
|
|
+ [self presentViewController:_shareOC animated:YES completion:nil];
|
|
|
}
|
|
|
|
|
|
[self tableViewReloadData];
|
|
@@ -1923,9 +1920,7 @@
|
|
|
}
|
|
|
}];
|
|
|
|
|
|
- if (openWindow) {
|
|
|
- [_hud visibleIndeterminateHud];
|
|
|
- }
|
|
|
+ [_hud visibleIndeterminateHud];
|
|
|
}
|
|
|
|
|
|
- (void)share:(tableMetadata *)metadata serverUrl:(NSString *)serverUrl password:(NSString *)password permission:(NSInteger)permission hideDownload:(BOOL)hideDownload
|
|
@@ -1938,7 +1933,7 @@
|
|
|
|
|
|
if (errorCode == 0 && [account isEqualToString:appDelegate.activeAccount]) {
|
|
|
|
|
|
- [self readShareWithAccount:account openWindow:YES metadata:metadata];
|
|
|
+ [self readShareWithAccount:account metadata:metadata];
|
|
|
|
|
|
} else if (errorCode != 0) {
|
|
|
|
|
@@ -1970,7 +1965,7 @@
|
|
|
appDelegate.sharesUserAndGroup = result[1];
|
|
|
}
|
|
|
|
|
|
- [self readShareWithAccount:account openWindow:YES metadata:metadata];
|
|
|
+ [self readShareWithAccount:account metadata:metadata];
|
|
|
|
|
|
} else if (errorCode != 0) {
|
|
|
|
|
@@ -1994,7 +1989,7 @@
|
|
|
|
|
|
if (errorCode == 0 && [account isEqualToString:appDelegate.activeAccount]) {
|
|
|
|
|
|
- [self readShareWithAccount:account openWindow:YES metadata:metadata];
|
|
|
+ [self readShareWithAccount:account metadata:metadata];
|
|
|
|
|
|
} else if (errorCode != 0) {
|
|
|
|
|
@@ -2042,7 +2037,7 @@
|
|
|
|
|
|
if (errorCode == 0 && [account isEqualToString:appDelegate.activeAccount]) {
|
|
|
|
|
|
- [self readShareWithAccount:account openWindow:YES metadata:metadata];
|
|
|
+ [self readShareWithAccount:account metadata:metadata];
|
|
|
|
|
|
} else if (errorCode != 0) {
|
|
|
|
|
@@ -2066,7 +2061,7 @@
|
|
|
tableMetadata *metadata = [[NCMainCommon sharedInstance] getMetadataFromSectionDataSourceIndexPath:indexPath sectionDataSource:sectionDataSource];
|
|
|
|
|
|
if (metadata)
|
|
|
- [appDelegate.activeMain readShareWithAccount:appDelegate.activeAccount openWindow:YES metadata:metadata];
|
|
|
+ [appDelegate.activeMain readShareWithAccount:appDelegate.activeAccount metadata:metadata];
|
|
|
}
|
|
|
|
|
|
- (void)tapActionConnectionMounted:(UITapGestureRecognizer *)tapGesture
|
|
@@ -3204,7 +3199,7 @@
|
|
|
height:50.0
|
|
|
type:AHKActionSheetButtonTypeDefault
|
|
|
handler:^(AHKActionSheet *as) {
|
|
|
- [appDelegate.activeMain readShareWithAccount:appDelegate.activeAccount openWindow:YES metadata:self.metadata];
|
|
|
+ [appDelegate.activeMain readShareWithAccount:appDelegate.activeAccount metadata:self.metadata];
|
|
|
}];
|
|
|
}
|
|
|
|
|
@@ -3393,7 +3388,7 @@
|
|
|
height: 50.0
|
|
|
type:AHKActionSheetButtonTypeDefault
|
|
|
handler:^(AHKActionSheet *as) {
|
|
|
- [appDelegate.activeMain readShareWithAccount:appDelegate.activeAccount openWindow:YES metadata:self.metadata];
|
|
|
+ [appDelegate.activeMain readShareWithAccount:appDelegate.activeAccount metadata:self.metadata];
|
|
|
}];
|
|
|
}
|
|
|
|