mirror of
https://github.com/sochix/TLSharp.git
synced 2025-12-06 08:02:00 +01:00
Merge pull request #2 from siml173/siml173-patch-2
Create CreateChatRequest
This commit is contained in:
commit
0ced5a40f1
44
TLSharp.Core/Requests/CreateChatRequest
Normal file
44
TLSharp.Core/Requests/CreateChatRequest
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using TLSharp.Core.MTProto;
|
||||
|
||||
namespace TLSharp.Core.Requests
|
||||
{
|
||||
class CreateChatRequest : MTProtoRequest
|
||||
{
|
||||
private List<InputUserContactConstructor> _id;
|
||||
private string _title;
|
||||
|
||||
public Messages_statedMessageConstructor message;
|
||||
public CreateChatRequest(List<InputUserContactConstructor> id, string title)
|
||||
{
|
||||
_id = id;
|
||||
_title = title;
|
||||
}
|
||||
|
||||
public override void OnSend(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(0x419d9aee);
|
||||
writer.Write(0x1cb5c415); // vector#1cb5c415
|
||||
writer.Write(_id.Count); // vector length
|
||||
foreach (var id in _id)
|
||||
id.Write(writer);
|
||||
Serializers.String.write(writer, _title);
|
||||
}
|
||||
|
||||
public override void OnResponse(BinaryReader reader)
|
||||
{
|
||||
message = TL.Parse<Messages_statedMessageConstructor>(reader);
|
||||
}
|
||||
|
||||
public override void OnException(Exception exception)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override bool Confirmed { get { return true; } }
|
||||
private readonly bool responded;
|
||||
public override bool Responded { get { return responded; } }
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue