marinofaggiana 4 years ago
parent
commit
654ec27e8a

+ 1 - 1
iOSClient/Main/CCMain.m

@@ -1137,7 +1137,7 @@
                             BOOL result = [[NCEndToEndMetadata sharedInstance] decoderMetadata:e2eMetadata privateKey:[CCUtility getEndToEndPrivateKey:account] serverUrl:self.serverUrl account:account url:appDelegate.activeUrl];
                             
                             if (result == false) {
-                                [[NCContentPresenter shared] messageNotification:@"_error_e2ee_" description:@"_e2e_error_decode_metadata_" delay:k_dismissAfterSecond type:messageTypeError errorCode:-999];
+                                [[NCContentPresenter shared] messageNotification:@"_error_e2ee_" description:@"_e2e_error_decode_metadata_" delay:k_dismissAfterSecond type:messageTypeError errorCode:k_CCErrorInternalError];
                             }
                                                         
                         } else if (errorCode != 404) {

+ 8 - 1
iOSClient/Settings/NCManageEndToEndEncryption.m

@@ -45,12 +45,18 @@
     
     BOOL isE2EEEnabled = [[NCManageDatabase sharedInstance] getCapabilitiesServerBoolWithAccount:appDelegate.activeAccount elements:NCElementsJSON.shared.capabilitiesE2EEEnabled exists:false];
     NSString *versionE2EE = [[NCManageDatabase sharedInstance] getCapabilitiesServerStringWithAccount:appDelegate.activeAccount elements:NCElementsJSON.shared.capabilitiesE2EEApiVersion];
-
+    if (![versionE2EE isEqual:k_E2EE_API]) {
+        [[NCContentPresenter shared] messageNotification:@"_error_e2ee_" description:@"_err_e2ee_app_version_" delay:k_dismissAfterSecond type:messageTypeError errorCode:k_CCErrorInternalError];
+    }
+    
     if (isE2EEEnabled == NO || ![versionE2EE isEqual:k_E2EE_API]) {
         
         // Section SERVICE NOT AVAILABLE -------------------------------------------------
         
         section = [XLFormSectionDescriptor formSection];
+        if (isE2EEEnabled) {
+            section.footerTitle = [NSString stringWithFormat:@"End-to-End Encryption V. %@", versionE2EE];
+        }
         [form addFormSection:section];
         
         row = [XLFormRowDescriptor formRowDescriptorWithTag:@"serviceActivated" rowType:XLFormRowDescriptorTypeInfo title:NSLocalizedString(@"_e2e_settings_not_available_", nil)];
@@ -72,6 +78,7 @@
         // Section SERVICE ACTIVATED -------------------------------------------------
         
         section = [XLFormSectionDescriptor formSection];
+        section.footerTitle = [NSString stringWithFormat:@"End-to-End Encryption V. %@", versionE2EE];
         [form addFormSection:section];
         
         row = [XLFormRowDescriptor formRowDescriptorWithTag:@"serviceActivated" rowType:XLFormRowDescriptorTypeInfo title:NSLocalizedString(@"_e2e_settings_activated_", nil)];

+ 1 - 0
iOSClient/Supporting Files/en.lproj/Localizable.strings

@@ -790,6 +790,7 @@
 "_internal_generic_error_"              = "internal error";
 "_editor_unknown_"                      = "Failed to open file: Editor is unknown";
 "_err_asset_not_found_"                 = "Error photo/video not found locally, removed from upload";
+"_err_e2ee_app_version_"                = "Error, the version of app End-to-End Encryption is not compatible, please update your server";
 
 // QRCode