fix settings for media encryption: media encryption mandatory uncheck itself if media encryption is none

This commit is contained in:
Danmei Chen 2022-02-11 18:19:36 +01:00 committed by QuentinArguillere
parent c47580beaf
commit fab524f5d0
2 changed files with 14 additions and 2 deletions

View file

@ -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"]);

View file

@ -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 {