private void button1_Click_2(object sender, EventArgs e) { TLInputPeerChannel from = new TLInputPeerChannel(); from.setAccessHash(2120444971788660000); from.setChannelId(1007286733); TLInputPeerSelf to = new TLInputPeerSelf(); TLIntVector ids = new TLIntVector(); ids.add(2061); TLLongVector rands = new TLLongVector(); rands.add(986875756); TLRequestMessagesForwardMessages fw = new TLRequestMessagesForwardMessages(); fw.setFromPeer(from); fw.setToPeer(to); fw.setId(ids); fw.setRandomId(rands); NewApi.Api().doRpcCall(fw); }
public override void deserializeBody(InputStream stream, TLContext context) { this.channelId = StreamingUtils.readInt(stream); this.messages = StreamingUtils.readTLIntVector(stream, context); this.pts = StreamingUtils.readInt(stream); this.ptsCount = StreamingUtils.readInt(stream); }
public virtual void setMessages(TLIntVector messages) { this.messages = messages; }
public virtual void setId(TLIntVector value) { this.id = value; }
public override void deserializeBody(InputStream stream, TLContext context) { this.id = StreamingUtils.readTLIntVector(stream, context); }
public virtual void setUsers(TLIntVector users) { this.users = users; }
public virtual void setId(TLIntVector id) { this.id = id; }
public override void deserializeBody(InputStream stream, TLContext context) { base.deserializeBody(stream, context); this.exportCard = StreamingUtils.readTLIntVector(stream, context); }
private async void ForwardB_Click(object sender, EventArgs e) { if (ForwardTB.Text.Trim() != "" && textBox1.Text.Trim() != "") { Loading(ForwardB, true); string notify = ""; if (NewApi.isAuthenticated()) { TLInputPeerUser iuser = null; Random rand = new Random(); string search = textBox1.Text.Trim().Replace("@", "").Replace("+", "").Replace(" ", "").ToLower(); TLUser user = await FindPeer(search); if (user != null) { TLInputPeerUser Puser = new TLInputPeerUser(); Puser.setAccessHash(user.getAccessHash()); Puser.setUserId(user.getId()); if (search == null || search == "") { search = user.getFirstName() + " " + user.getLastName(); } string[] lines = System.Text.RegularExpressions.Regex.Split(ForwardTB.Text.Trim(), "\r\n"); long Faccess = 0; int FId = 0; TLIntVector mId = new TLIntVector(); FId = Convert.ToInt32(lines[0].Trim() + ""); Faccess = Convert.ToInt64(lines[1].Trim() + ""); mId.add(Convert.ToInt32(lines[2].Trim() + "")); TLInputPeerUser from = new TLInputPeerUser(); from.setAccessHash(Faccess); from.setUserId(FId); TLLongVector lRand = new TLLongVector(); lRand.add(rand.Next()); TLRequestMessagesForwardMessages req = new TLRequestMessagesForwardMessages(); req.setFromPeer(from); req.setToPeer(Puser); req.setId(mId); req.setRandomId(lRand); req.enableSilent(true); req.enableWithMyScore(true); try { //var res = Api.doRpcCall(req); var res = await WTask.Task.Run(() => NewApi.Api().doRpcCall(req)); notify = "پیام به " + search + " فوروارد شد."; //NotifyBar.ForeColor = Color.Green; } catch (Exception ex) { notify = "خطا: " + ex.Message; //NotifyBar.ForeColor = Color.Red; } } } Loading(ForwardB, false, notify); } }
public override void deserializeBody(InputStream stream, TLContext context) { this.title = StreamingUtils.readTLString(stream); this.users = StreamingUtils.readTLIntVector(stream, context); }