Пример #1
0
        public void SaveCallsSecurity(TLCallsSecurity callsSecurity)
        {
            _callsSecurity = callsSecurity;

            if (callsSecurity == null)
            {
                FileUtils.Delete(_callsSecuritySyncRoot, Constants.CallsSecurityFileName);
            }
            else
            {
                TLUtils.SaveObjectToMTProtoFile(_callsSecuritySyncRoot, Constants.CallsSecurityFileName, _callsSecurity);
            }
        }
Пример #2
0
        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);
        }
Пример #3
0
 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);
 }