Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/ios.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarino Faggiana <ios@nextcloud.com>2022-07-13 17:57:00 +0300
committerGitHub <noreply@github.com>2022-07-13 17:57:00 +0300
commit58c157032ce1add8716a7d700c742a39ae1b7eda (patch)
tree04a95a26deab3ec743e0a462a7260629d55d3821 /iOSClient
parent753c86d70afa2633de354bd13813b7942593efc7 (diff)
parent46999c51b394f96d788e76e6b02cd6efdeb81c62 (diff)
Merge pull request #2074 from nextcloud/e2ee
E2ee
Diffstat (limited to 'iOSClient')
-rw-r--r--iOSClient/Files/NCFiles.swift10
-rw-r--r--iOSClient/Menu/NCCollectionViewCommon+Menu.swift4
-rw-r--r--iOSClient/Settings/NCEndToEndInitialize.swift6
-rw-r--r--iOSClient/Settings/NCManageEndToEndEncryption.m7
-rw-r--r--iOSClient/Supporting Files/en.lproj/Localizable.strings2
5 files changed, 16 insertions, 13 deletions
diff --git a/iOSClient/Files/NCFiles.swift b/iOSClient/Files/NCFiles.swift
index b8a9b3c09..94a07257c 100644
--- a/iOSClient/Files/NCFiles.swift
+++ b/iOSClient/Files/NCFiles.swift
@@ -77,9 +77,7 @@ class NCFiles: NCCollectionViewCommon {
override func reloadDataSource(forced: Bool = true) {
super.reloadDataSource()
- DispatchQueue.main.async {
- self.refreshControl.endRefreshing()
- }
+ DispatchQueue.main.async { self.refreshControl.endRefreshing() }
guard !isSearching, !appDelegate.account.isEmpty, !appDelegate.urlBase.isEmpty, !serverUrl.isEmpty else { return }
self.metadatasSource = NCManageDatabase.shared.getMetadatas(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", appDelegate.account, serverUrl))
@@ -106,9 +104,7 @@ class NCFiles: NCCollectionViewCommon {
providers: self.providers,
searchResults: self.searchResults)
- DispatchQueue.main.async {
- self.collectionView.reloadData()
- }
+ DispatchQueue.main.async { self.collectionView.reloadData() }
}
override func reloadDataSourceNetwork(forced: Bool = false) {
@@ -134,6 +130,8 @@ class NCFiles: NCCollectionViewCommon {
if metadatasUpdate?.count ?? 0 > 0 || metadatasDelete?.count ?? 0 > 0 || forced {
self.reloadDataSource(forced: false)
+ } else if self.dataSource.metadatasSource.isEmpty {
+ DispatchQueue.main.async { self.collectionView.reloadData() }
}
}
}
diff --git a/iOSClient/Menu/NCCollectionViewCommon+Menu.swift b/iOSClient/Menu/NCCollectionViewCommon+Menu.swift
index 5c64a6a19..4f4d54a8f 100644
--- a/iOSClient/Menu/NCCollectionViewCommon+Menu.swift
+++ b/iOSClient/Menu/NCCollectionViewCommon+Menu.swift
@@ -325,7 +325,7 @@ extension NCCollectionViewCommon {
//
// SET FOLDER E2EE
//
- if !metadata.e2eEncrypted && metadata.directory && CCUtility.isEnd(toEndEnabled: appDelegate.account) && metadata.serverUrl == serverUrlHome {
+ if !metadata.e2eEncrypted && metadata.directory && CCUtility.isEnd(toEndEnabled: appDelegate.account) && metadata.serverUrl == serverUrlHome && metadata.size == 0 {
actions.append(
NCMenuAction(
title: NSLocalizedString("_e2e_set_folder_encrypted_", comment: ""),
@@ -350,7 +350,7 @@ extension NCCollectionViewCommon {
//
// UNSET FOLDER E2EE
//
- if metadata.e2eEncrypted && metadata.directory && CCUtility.isEnd(toEndEnabled: appDelegate.account) && metadata.serverUrl == serverUrlHome {
+ if metadata.e2eEncrypted && metadata.directory && CCUtility.isEnd(toEndEnabled: appDelegate.account) && metadata.serverUrl == serverUrlHome && metadata.size == 0 {
actions.append(
NCMenuAction(
title: NSLocalizedString("_e2e_remove_folder_encrypted_", comment: ""),
diff --git a/iOSClient/Settings/NCEndToEndInitialize.swift b/iOSClient/Settings/NCEndToEndInitialize.swift
index ead2193c6..737d68097 100644
--- a/iOSClient/Settings/NCEndToEndInitialize.swift
+++ b/iOSClient/Settings/NCEndToEndInitialize.swift
@@ -210,8 +210,8 @@ class NCEndToEndInitialize: NSObject {
case NCGlobal.shared.errorResourceNotFound:
// message
- let e2ePassphrase = NYMnemonic.generateString(128, language: "english")
- let message = "\n" + NSLocalizedString("_e2e_settings_view_passphrase_", comment: "") + "\n\n" + e2ePassphrase!
+ guard let e2ePassphrase = NYMnemonic.generateString(128, language: "english") else { return }
+ let message = "\n" + NSLocalizedString("_e2e_settings_view_passphrase_", comment: "") + "\n\n" + e2ePassphrase
let alertController = UIAlertController(title: NSLocalizedString("_e2e_settings_title_", comment: ""), message: NSLocalizedString(message, comment: ""), preferredStyle: .alert)
@@ -220,9 +220,7 @@ class NCEndToEndInitialize: NSObject {
var privateKeyString: NSString?
guard let privateKeyChiper = NCEndToEndEncryption.sharedManager().encryptPrivateKey(self.appDelegate.userId, directory: CCUtility.getDirectoryUserData(), passphrase: e2ePassphrase, privateKey: &privateKeyString) else {
-
NCContentPresenter.shared.messageNotification("E2E privateKey", description: "Serious internal error to create PrivateKey chiper", delay: NCGlobal.shared.dismissAfterSecond, type: NCContentPresenter.messageType.error, errorCode: errorCode, priority: .max)
-
return
}
diff --git a/iOSClient/Settings/NCManageEndToEndEncryption.m b/iOSClient/Settings/NCManageEndToEndEncryption.m
index 0d22adb5e..147671409 100644
--- a/iOSClient/Settings/NCManageEndToEndEncryption.m
+++ b/iOSClient/Settings/NCManageEndToEndEncryption.m
@@ -345,8 +345,13 @@
NSString *message = [NSString stringWithFormat:@"\n%@\n\n\n%@", NSLocalizedString(@"_e2e_settings_the_passphrase_is_", nil), e2ePassphrase];
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"_info_", nil) message:message preferredStyle:UIAlertControllerStyleAlert];
- UIAlertAction *okAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK action") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { }];
+ UIAlertAction *okAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"_ok_", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { }];
+ UIAlertAction *copyPassphrase = [UIAlertAction actionWithTitle:NSLocalizedString(@"_copy_passphrase_", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
+ UIPasteboard.generalPasteboard.string = e2ePassphrase;
+ }];
+
[alertController addAction:okAction];
+ [alertController addAction:copyPassphrase];
[self presentViewController:alertController animated:YES completion:nil];
} else if ([passcodeType isEqualToString:@"removeLocallyEncryption"]) {
diff --git a/iOSClient/Supporting Files/en.lproj/Localizable.strings b/iOSClient/Supporting Files/en.lproj/Localizable.strings
index ef118567c..5adba0229 100644
--- a/iOSClient/Supporting Files/en.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/en.lproj/Localizable.strings
@@ -875,6 +875,8 @@
"_waiting_for_" = "Waiting for:";
"_reachable_wifi_" = "network reachable via Wi-Fi or cable";
"_ITMS-90076_" = "Due to a change in the Nextcloud application identifier, the settings and password for accessing your cloud are reset, so please re-enter your account data and check your Settings. We are sorry about what happened but it is not up to us.";
+"_copy_passphrase_" = "Copy passphrase";
+
// Video
"_select_trace_" = "Select the trace";