瀏覽代碼

2236

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 年之前
父節點
當前提交
ebf0a01cd7
共有 1 個文件被更改,包括 14 次插入2 次删除
  1. 14 2
      iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

+ 14 - 2
iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

@@ -1278,6 +1278,17 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
     }
 }
 
+// MARK: - E2EE
+
+extension NCCollectionViewCommon: NCEndToEndInitializeDelegate {
+
+    func endToEndInitializeSuccess() {
+        if let metadata = appDelegate.activeMetadata {
+            pushMetadata(metadata)
+        }
+    }
+}
+
 // MARK: - Collection View
 
 extension NCCollectionViewCommon: UICollectionViewDelegate {
@@ -1300,8 +1311,9 @@ extension NCCollectionViewCommon: UICollectionViewDelegate {
         }
 
         if metadata.e2eEncrypted && !CCUtility.isEnd(toEndEnabled: appDelegate.account) {
-            let error = NKError(errorCode: NCGlobal.shared.errorE2EENotEnabled, errorDescription: "_e2e_goto_settings_for_enable_")
-            NCContentPresenter.shared.showInfo(error: error)
+            let e2ee = NCEndToEndInitialize()
+            e2ee.delegate = self
+            e2ee.initEndToEndEncryption()
             return
         }