From 8df066aadc29bc49b70479c61d024ceb938d9e06 Mon Sep 17 00:00:00 2001 From: mohammad ahmady Date: Sat, 16 Jan 2016 12:18:59 +0330 Subject: [PATCH] Create CreateChatRequest --- TLSharp.Core/Requests/CreateChatRequest | 44 +++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 TLSharp.Core/Requests/CreateChatRequest diff --git a/TLSharp.Core/Requests/CreateChatRequest b/TLSharp.Core/Requests/CreateChatRequest new file mode 100644 index 0000000..6151b2c --- /dev/null +++ b/TLSharp.Core/Requests/CreateChatRequest @@ -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 _id; + private string _title; + + public Messages_statedMessageConstructor message; + public CreateChatRequest(List 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(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; } } + } +}