mirror of
https://github.com/sochix/TLSharp.git
synced 2025-12-06 08:02:00 +01:00
Add files via upload
This commit is contained in:
parent
9d69d4881b
commit
a2669bfe1a
40
TLSharp.Core/Requests/AuthSendSmsRequest.cs
Normal file
40
TLSharp.Core/Requests/AuthSendSmsRequest.cs
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using TLSharp.Core.MTProto;
|
||||||
|
|
||||||
|
namespace TLSharp.Core.Requests
|
||||||
|
{
|
||||||
|
public class AuthSendSmsRequest : MTProtoRequest
|
||||||
|
{
|
||||||
|
private readonly string _phoneNumber;
|
||||||
|
private readonly string _phoneCodeHash;
|
||||||
|
public bool _smsSent;
|
||||||
|
|
||||||
|
public AuthSendSmsRequest(string phoneNumber, string phoneCodeHash)
|
||||||
|
{
|
||||||
|
_phoneNumber = phoneNumber;
|
||||||
|
_phoneCodeHash = phoneCodeHash;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnSend(BinaryWriter writer)
|
||||||
|
{
|
||||||
|
writer.Write(0xda9f3e8);
|
||||||
|
Serializers.String.write(writer, _phoneNumber);
|
||||||
|
Serializers.String.write(writer, _phoneCodeHash);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnResponse(BinaryReader reader)
|
||||||
|
{
|
||||||
|
var dataCode = reader.ReadUInt32();
|
||||||
|
_smsSent = reader.ReadUInt32() == 0x997275b5;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnException(Exception exception)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool Confirmed => true;
|
||||||
|
public override bool Responded { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue