예제 #1
0
        public AuthKeyNegotiator(
            [NotNull] IClientTransportConfig clientTransportConfig,
            [NotNull] IMTProtoClientBuilder mtProtoBuilder,
            [NotNull] TLRig tlRig,
            [NotNull] INonceGenerator nonceGenerator,
            [NotNull] IHashServices hashServices,
            [NotNull] IEncryptionServices encryptionServices,
            [NotNull] IKeyChain keyChain)
        {
            Argument.IsNotNull(() => clientTransportConfig);
            Argument.IsNotNull(() => mtProtoBuilder);
            Argument.IsNotNull(() => tlRig);
            Argument.IsNotNull(() => nonceGenerator);
            Argument.IsNotNull(() => hashServices);
            Argument.IsNotNull(() => encryptionServices);
            Argument.IsNotNull(() => keyChain);

            _clientTransportConfig = clientTransportConfig;
            _mtProtoBuilder        = mtProtoBuilder;
            _tlRig              = tlRig;
            _nonceGenerator     = nonceGenerator;
            _hashServices       = hashServices;
            _encryptionServices = encryptionServices;
            _keyChain           = keyChain;
        }
예제 #2
0
        public TelegramClient(IClientTransportConfig transportConfig,
                              ConnectionConfig connectionConfig,
                              TelegramAppInfo appInfo,
                              IMTProtoClientBuilder builder = null)
        {
            if (builder == null)
            {
                builder = MTProtoClientBuilder.Default;
            }

            _transportConfig = transportConfig;
            _appInfo         = appInfo;
            _connection      = builder.BuildConnection(_transportConfig);
            _connection.Configure(connectionConfig);
            _methods = new TelegramAsyncMethods(_connection);
        }
예제 #3
0
        public TelegramClient(IClientTransportConfig transportConfig,
            ConnectionConfig connectionConfig,
            TelegramAppInfo appInfo,
            IMTProtoClientBuilder builder = null)
        {
            if (builder == null)
            {
                builder = MTProtoClientBuilder.Default;
            }

            _transportConfig = transportConfig;
            _appInfo = appInfo;
            _connection = builder.BuildConnection(_transportConfig);
            _connection.Configure(connectionConfig);
            _methods = new TelegramAsyncMethods(_connection);
        }
예제 #4
0
 public AuthKeyNegotiator(
     [NotNull] IClientTransportConfig clientTransportConfig,
     [NotNull] IMTProtoClientBuilder mtProtoBuilder,
     [NotNull] TLRig tlRig,
     [NotNull] INonceGenerator nonceGenerator,
     [NotNull] IHashServices hashServices,
     [NotNull] IEncryptionServices encryptionServices,
     [NotNull] IKeyChain keyChain)
 {
     _clientTransportConfig = clientTransportConfig;
     _mtProtoBuilder = mtProtoBuilder;
     _tlRig = tlRig;
     _nonceGenerator = nonceGenerator;
     _hashServices = hashServices;
     _encryptionServices = encryptionServices;
     _keyChain = keyChain;
 }
예제 #5
0
 static MTProtoClientBuilder()
 {
     Default = CreateDefault();
 }
예제 #6
0
 static MTProtoClientBuilder()
 {
     Default = CreateDefault();
 }