From 2dac2cef6b940f863edc69a4908260f80bb19045 Mon Sep 17 00:00:00 2001 From: "benoit.martins" Date: Sun, 14 May 2023 23:00:17 +0200 Subject: [PATCH] Add bundle_mode_preference toggle in account settings --- Classes/LinphoneCoreSettingsStore.m | 15 +++++++++++---- Settings/InAppSettings.bundle/Account.plist | 10 ++++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/Classes/LinphoneCoreSettingsStore.m b/Classes/LinphoneCoreSettingsStore.m index 604fb1fd0..28a5c6d77 100644 --- a/Classes/LinphoneCoreSettingsStore.m +++ b/Classes/LinphoneCoreSettingsStore.m @@ -155,7 +155,8 @@ // default values { [self setBool:NO forKey:@"account_pushnotification_preference"]; - [self setBool:YES forKey:@"account_push_presence_preference"]; + [self setBool:YES forKey:@"account_push_presence_preference"]; + [self setBool:NO forKey:@"account_bundle_mode_preference"]; [self setObject:@"" forKey:@"account_mandatory_username_preference"]; [self setObject:@"" forKey:@"account_mandatory_domain_preference"]; [self setCString:"" forKey:@"account_display_name_preference"]; @@ -185,10 +186,13 @@ { BOOL pushEnabled = linphone_account_params_get_push_notification_allowed(accountParams); [self setBool:pushEnabled forKey:@"account_pushnotification_preference"]; - + BOOL pushPresenceEnabled = linphone_account_params_get_publish_enabled(accountParams); - [self setBool:pushPresenceEnabled forKey:@"account_push_presence_preference"]; - + [self setBool:pushPresenceEnabled forKey:@"account_push_presence_preference"]; + + BOOL bundleModeEnabled = linphone_account_params_rtp_bundle_enabled(accountParams); + [self setBool:bundleModeEnabled forKey:@"account_bundle_mode_preference"]; + const LinphoneAddress *identity_addr = linphone_account_params_get_identity_address(accountParams); const char *server_addr = linphone_account_params_get_server_addr(accountParams); LinphoneAddress *proxy_addr = linphone_core_interpret_url_2(LC, server_addr, false); @@ -619,6 +623,7 @@ int expire = [self integerForKey:@"account_expire_preference"]; BOOL pushnotification = [self boolForKey:@"account_pushnotification_preference"]; BOOL publishPrensence = [self boolForKey:@"account_push_presence_preference"]; + BOOL bundlemode = [self boolForKey:@"account_bundle_mode_preference"]; NSString *prefix = [self stringForKey:@"account_prefix_preference"]; BOOL use_prefix = [self boolForKey:@"apply_international_prefix_for_calls_and_chats"]; NSString *proxyAddress = [self stringForKey:@"account_proxy_preference"]; @@ -698,6 +703,8 @@ // use empty string "" instead of NULL to avoid being overwritten by default proxy config values linphone_account_params_set_push_notification_allowed(newAccountParams, pushnotification); + linphone_account_params_enable_rtp_bundle(newAccountParams, bundlemode); + linphone_account_params_set_push_notification_allowed(newAccountParams, pushnotification); linphone_account_params_set_remote_push_notification_allowed(newAccountParams, pushnotification); linphone_account_params_set_publish_enabled(newAccountParams, publishPrensence); diff --git a/Settings/InAppSettings.bundle/Account.plist b/Settings/InAppSettings.bundle/Account.plist index 528c6c96c..95d8e338c 100644 --- a/Settings/InAppSettings.bundle/Account.plist +++ b/Settings/InAppSettings.bundle/Account.plist @@ -298,6 +298,16 @@ Type PSToggleSwitchSpecifier + + Title + Bundle Mode + Key + account_bundle_mode_preference + Type + PSToggleSwitchSpecifier + DefaultValue + + Key account_mandatory_change_password