diff --git a/TLSharp.Core/Requests/AddChatUserRequest b/TLSharp.Core/Requests/AddChatUserRequest new file mode 100644 index 0000000..74b9b84 --- /dev/null +++ b/TLSharp.Core/Requests/AddChatUserRequest @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.IO; +using TLSharp.Core.MTProto; + +namespace TLSharp.Core.Requests +{ + class AddChatUserRequest : MTProtoRequest + { + private int _chatID; + + private InputUserContactConstructor _user; + private string _title; + + + public Messages_statedMessageConstructor message; + public AddChatUserRequest(int chatID, InputUserContactConstructor user) + { + _chatID = chatID; + _user = user; + } + + public override void OnSend(BinaryWriter writer) + { + writer.Write(0x2ee9ee9e); + writer.Write(_chatID); + _user.Write(writer); + writer.Write(1); + } + + 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; } } + } +}