2016-02-01 21:39:39 +01:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
using TLSharp.Core.MTProto;
|
|
|
|
|
|
|
|
|
|
|
|
namespace TLSharp.Core.Requests
|
|
|
|
|
|
{
|
|
|
|
|
|
public class ImportByUserName : MTProtoRequest
|
|
|
|
|
|
{
|
|
|
|
|
|
private readonly string _userName;
|
2016-02-01 21:58:51 +01:00
|
|
|
|
public int id { get; private set; }
|
2016-02-01 21:39:39 +01:00
|
|
|
|
public ImportByUserName(string userName)
|
|
|
|
|
|
{
|
|
|
|
|
|
_userName = userName;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void OnSend(BinaryWriter writer)
|
|
|
|
|
|
{
|
2016-02-01 21:58:51 +01:00
|
|
|
|
writer.Write(0xBF0131C);
|
2016-02-01 21:39:39 +01:00
|
|
|
|
Serializers.String.write(writer, _userName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void OnResponse(BinaryReader reader)
|
|
|
|
|
|
{
|
|
|
|
|
|
var code = reader.ReadUInt32();
|
2016-02-01 21:58:51 +01:00
|
|
|
|
id = reader.ReadInt32();
|
2016-02-01 21:39:39 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void OnException(Exception exception)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2016-02-01 21:58:51 +01:00
|
|
|
|
public override bool Confirmed => true;
|
2016-02-01 21:39:39 +01:00
|
|
|
|
public override bool Responded { get; }
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|