diff --git a/Classes/LinphoneCoreSettingsStore.m b/Classes/LinphoneCoreSettingsStore.m index 5e9c11448..f0c9f6f9c 100644 --- a/Classes/LinphoneCoreSettingsStore.m +++ b/Classes/LinphoneCoreSettingsStore.m @@ -333,7 +333,12 @@ [self setBool:[lm lpConfigBoolForKey:@"repeat_call_notification"] forKey:@"repeat_call_notification_preference"]; - [self setBool:linphone_core_is_media_encryption_mandatory(LC) forKey:@"media_encrption_mandatory_preference"]; + if (linphone_core_get_media_encryption(LC) == LinphoneMediaEncryptionNone) { + [self setBool:FALSE forKey:@"media_encrption_mandatory_preference"]; + linphone_core_set_media_encryption_mandatory(LC, FALSE); + } else { + [self setBool:linphone_core_is_media_encryption_mandatory(LC) forKey:@"media_encrption_mandatory_preference"]; + } [self setBool:[lm lpConfigBoolForKey:@"pref_accept_early_media"] forKey:@"pref_accept_early_media_preference"]; } @@ -866,8 +871,10 @@ linphone_core_set_media_encryption(LC, LinphoneMediaEncryptionZRTP); else if (menc && [menc compare:@"DTLS"] == NSOrderedSame) linphone_core_set_media_encryption(LC, LinphoneMediaEncryptionDTLS); - else + else { linphone_core_set_media_encryption(LC, LinphoneMediaEncryptionNone); + [self setBool:FALSE forKey:@"media_encrption_mandatory_preference"]; + } linphone_core_enable_adaptive_rate_control(LC, [self boolForKey:@"adaptive_rate_control_preference"]); diff --git a/Classes/SettingsView.m b/Classes/SettingsView.m index a5325ce47..4064de1fb 100644 --- a/Classes/SettingsView.m +++ b/Classes/SettingsView.m @@ -232,6 +232,11 @@ UIScrollView *scrollView = self.tableView; [scrollView setContentInset:inset]; [scrollView setScrollIndicatorInsets:inset]; + // specific for media encryption + if (linphone_core_get_media_encryption(LC) == LinphoneMediaEncryptionNone && linphone_core_is_media_encryption_mandatory(LC)) { + linphone_core_set_media_encryption_mandatory(LC, FALSE); + [self.tableView reloadData]; + } } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {