public TLChatSettings GetChatSettings() { if (_chatSettings != null) { return(_chatSettings); } _chatSettings = TLUtils.OpenObjectFromMTProtoFile <TLChatSettings>(_chatSettingsSyncRoot, Constants.ChatSettingsFileName) ?? new TLChatSettings { AutoDownloadPhotoPrivateChats = true, AutoDownloadPhotoGroups = true, AutoDownloadAudioPrivateChats = true, AutoDownloadAudioGroups = true }; return(_chatSettings); }
public ChatSettingsViewModel(ICacheService cacheService, ICommonErrorHandler errorHandler, IStateService stateService, INavigationService navigationService, IMTProtoService mtProtoService, ITelegramEventAggregator eventAggregator) : base(cacheService, errorHandler, stateService, navigationService, mtProtoService, eventAggregator) { _chatSettings = StateService.GetChatSettings(); StateService.GetNotifySettingsAsync( settings => { _locationServices = settings.LocationServices; _peopleHub = settings.PeopleHub; BeginOnUIThread(() => { NotifyOfPropertyChange(() => LocationServices); }); }); PropertyChanged += OnPropertyChanged; }
public void SaveChatSettings(TLChatSettings chatSettings) { _chatSettings = chatSettings; TLUtils.SaveObjectToMTProtoFile(_chatSettingsSyncRoot, Constants.ChatSettingsFileName, chatSettings); }