mirror of
https://github.com/sochix/TLSharp.git
synced 2026-04-09 16:35:11 +00:00
- Update layer to 23
- Start implementing get user by userName
This commit is contained in:
parent
e281f281dd
commit
1dce594e43
6 changed files with 63 additions and 1 deletions
35
TLSharp.Core/Requests/ImportByUserName.cs
Normal file
35
TLSharp.Core/Requests/ImportByUserName.cs
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using TLSharp.Core.MTProto;
|
||||
|
||||
namespace TLSharp.Core.Requests
|
||||
{
|
||||
public class ImportByUserName : MTProtoRequest
|
||||
{
|
||||
private readonly string _userName;
|
||||
public ImportByUserName(string userName)
|
||||
{
|
||||
_userName = userName;
|
||||
}
|
||||
|
||||
public override void OnSend(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(0xf93ccba3);
|
||||
Serializers.String.write(writer, _userName);
|
||||
}
|
||||
|
||||
public override void OnResponse(BinaryReader reader)
|
||||
{
|
||||
var code = reader.ReadUInt32();
|
||||
var peer = TL.Parse<Peer>(reader);
|
||||
}
|
||||
|
||||
public override void OnException(Exception exception)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override bool Confirmed { get; }
|
||||
public override bool Responded { get; }
|
||||
}
|
||||
}
|
||||
|
|
@ -16,7 +16,8 @@ namespace TLSharp.Core.Requests
|
|||
|
||||
public override void OnSend(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(0x1c900537); // invokeWithLayer18#1c900537
|
||||
writer.Write(0xda9b0d0d);
|
||||
writer.Write(23);// invokeWithLayer23#1c900537
|
||||
writer.Write(0x69796de9); // initConnection
|
||||
writer.Write(_apiId); // api id
|
||||
Serializers.String.write(writer, "WinPhone Emulator"); // device model
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue