public void SaveCallsSecurity(TLCallsSecurity callsSecurity) { _callsSecurity = callsSecurity; if (callsSecurity == null) { FileUtils.Delete(_callsSecuritySyncRoot, Constants.CallsSecurityFileName); } else { TLUtils.SaveObjectToMTProtoFile(_callsSecuritySyncRoot, Constants.CallsSecurityFileName, _callsSecurity); } }
public TLCallsSecurity GetCallsSecurity(bool defaultP2PContacts) { if (_callsSecurity != null) { return(_callsSecurity); } _callsSecurity = TLUtils.OpenObjectFromMTProtoFile <TLCallsSecurity>(_callsSecuritySyncRoot, Constants.CallsSecurityFileName) ?? new TLCallsSecurity { PeerToPeer = true }; _callsSecurity.Update(defaultP2PContacts); return(_callsSecurity); }
public CallsSecurityViewModel(ICacheService cacheService, ICommonErrorHandler errorHandler, IStateService stateService, INavigationService navigationService, IMTProtoService mtProtoService, ITelegramEventAggregator eventAggregator) : base(cacheService, errorHandler, stateService, navigationService, mtProtoService, eventAggregator) { _callsSecurity = StateService.GetCallsSecurity(true); }