Save VFS and Auto_download_mode changes

This commit is contained in:
Benoit Martins 2022-12-05 11:52:24 +01:00 committed by QuentinArguillere
parent 9e52922fff
commit 5407a18b57
2 changed files with 4 additions and 1 deletions

View file

@ -442,7 +442,7 @@
{
[self setCString:linphone_core_get_file_transfer_server(LC) forKey:@"file_transfer_server_url_preference"];
int maxSize = linphone_core_get_max_size_for_auto_download_incoming_files(LC);
[self setObject:maxSize==0 ? @"Always" : (maxSize==-1 ? @"Nerver" : @"Customize") forKey:@"auto_download_mode"];
[self setObject:maxSize==0 ? @"Always" : (maxSize==-1 ? @"Never" : @"Customize") forKey:@"auto_download_mode"];
[self setInteger:maxSize forKey:@"auto_download_incoming_files_max_size"];
[self setBool:[VFSUtil vfsEnabledWithGroupName:kLinphoneMsgNotificationAppGroupId] forKey:@"vfs_enabled_mode"];
[self setBool:[lm lpConfigBoolForKey:@"auto_write_to_gallery_preference" withDefault:YES] forKey:@"auto_write_to_gallery_mode"];

View file

@ -22,6 +22,7 @@
#import "LinphoneAppDelegate.h"
#import "PhoneMainView.h"
#import "Utils.h"
#import "linphoneapp-Swift.h"
#import "DCRoundSwitch.h"
@ -547,6 +548,7 @@ void update_hash_cbs(LinphoneAccountCreator *creator, LinphoneAccountCreatorStat
if(![LinphoneManager.instance lpConfigBoolForKey:@"auto_write_to_gallery_mode"]){
if(removeFromHiddenKeys){
[LinphoneManager.instance lpConfigSetBool:FALSE forKey:@"vfs_enabled_mode"];
[VFSUtil setVfsEnabbledWithEnabled:FALSE groupName:kLinphoneMsgNotificationAppGroupId];
if([LinphoneManager.instance lpConfigBoolForKey:@"auto_download_mode_is_never"]){
[keys addObject:@"auto_write_to_gallery_mode"];
}else{
@ -554,6 +556,7 @@ void update_hash_cbs(LinphoneAccountCreator *creator, LinphoneAccountCreatorStat
}
}else{
[LinphoneManager.instance lpConfigSetBool:TRUE forKey:@"vfs_enabled_mode"];
[VFSUtil setVfsEnabbledWithEnabled:TRUE groupName:kLinphoneMsgNotificationAppGroupId];
[hiddenKeys addObject:@"auto_write_to_gallery_mode"];
}
}