handling errors for spammers

This commit is contained in:
John Preston 2015-09-09 10:46:31 +03:00
parent 7a278729e1
commit ce678bad68
8 changed files with 103 additions and 71 deletions

View File

@ -488,6 +488,8 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org
"lng_report_spam" = "Report Spam"; "lng_report_spam" = "Report Spam";
"lng_report_spam_hide" = "Hide"; "lng_report_spam_hide" = "Hide";
"lng_report_spam_thanks" = "Thank you for your report!"; "lng_report_spam_thanks" = "Thank you for your report!";
"lng_cant_send_to_not_contact" = "Sorry, you can't send message to a user\nwho didn't add you to contacts right now.";
"lng_cant_invite_not_contact" = "Sorry, you can't invite a user who didn't\nadd you to contacts to groups right now.";
"lng_send_button" = "Send"; "lng_send_button" = "Send";
"lng_message_ph" = "Write a message.."; "lng_message_ph" = "Write a message..";

View File

@ -1282,7 +1282,7 @@ void CreateGroupBox::created(const MTPUpdates &updates) {
} }
bool CreateGroupBox::failed(const RPCError &error) { bool CreateGroupBox::failed(const RPCError &error) {
if (error.type().startsWith(qsl("FLOOD_WAIT_"))) return false; if (mtpIsFlood(error)) return false;
_createRequestId = 0; _createRequestId = 0;
if (error.type() == "NO_CHAT_TITLE") { if (error.type() == "NO_CHAT_TITLE") {
@ -1291,6 +1291,10 @@ bool CreateGroupBox::failed(const RPCError &error) {
} else if (error.type() == "USERS_TOO_FEW") { } else if (error.type() == "USERS_TOO_FEW") {
emit closed(); emit closed();
return true; return true;
} else if (error.type() == "PEER_FLOOD") {
emit closed();
App::wnd()->showLayer(new ConfirmBox(lang(lng_cant_invite_not_contact), true));
return true;
} }
return false; return false;
} }

View File

@ -3576,7 +3576,7 @@ void HistoryWidget::shareContact(const PeerId &peer, const QString &phone, const
sendFlags |= MTPmessages_SendMedia::flag_reply_to_msg_id; sendFlags |= MTPmessages_SendMedia::flag_reply_to_msg_id;
} }
h->addToBack(MTP_message(MTP_int(flags), MTP_int(newId), MTP_int(MTP::authedId()), App::peerToMTP(peer), MTPint(), MTPint(), MTP_int(replyToId()), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaContact(MTP_string(phone), MTP_string(fname), MTP_string(lname), MTP_int(userId)), MTPnullMarkup, MTPnullEntities)); h->addToBack(MTP_message(MTP_int(flags), MTP_int(newId), MTP_int(MTP::authedId()), App::peerToMTP(peer), MTPint(), MTPint(), MTP_int(replyToId()), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaContact(MTP_string(phone), MTP_string(fname), MTP_string(lname), MTP_int(userId)), MTPnullMarkup, MTPnullEntities));
h->sendRequestId = MTP::send(MTPmessages_SendMedia(MTP_int(sendFlags), p->input, MTP_int(replyTo), MTP_inputMediaContact(MTP_string(phone), MTP_string(fname), MTP_string(lname)), MTP_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), RPCFailHandlerPtr(), 0, 0, h->sendRequestId); h->sendRequestId = MTP::send(MTPmessages_SendMedia(MTP_int(sendFlags), p->input, MTP_int(replyTo), MTP_inputMediaContact(MTP_string(phone), MTP_string(fname), MTP_string(lname)), MTP_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::sendMessageFail), 0, 0, h->sendRequestId);
App::historyRegRandom(randomId, newId); App::historyRegRandom(randomId, newId);
@ -4485,7 +4485,7 @@ void HistoryWidget::onPhotoUploaded(MsgId newId, const MTPInputFile &file) {
if (replyTo) { if (replyTo) {
sendFlags |= MTPmessages_SendMedia::flag_reply_to_msg_id; sendFlags |= MTPmessages_SendMedia::flag_reply_to_msg_id;
} }
hist->sendRequestId = MTP::send(MTPmessages_SendMedia(MTP_int(sendFlags), item->history()->peer->input, MTP_int(replyTo), MTP_inputMediaUploadedPhoto(file, MTP_string("")), MTP_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::sendPhotoFailed, randomId), 0, 0, hist->sendRequestId); hist->sendRequestId = MTP::send(MTPmessages_SendMedia(MTP_int(sendFlags), item->history()->peer->input, MTP_int(replyTo), MTP_inputMediaUploadedPhoto(file, MTP_string("")), MTP_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::sendPhotoFail, randomId), 0, 0, hist->sendRequestId);
} }
} }
@ -4525,7 +4525,7 @@ void HistoryWidget::onDocumentUploaded(MsgId newId, const MTPInputFile &file) {
if (replyTo) { if (replyTo) {
sendFlags |= MTPmessages_SendMedia::flag_reply_to_msg_id; sendFlags |= MTPmessages_SendMedia::flag_reply_to_msg_id;
} }
hist->sendRequestId = MTP::send(MTPmessages_SendMedia(MTP_int(sendFlags), item->history()->peer->input, MTP_int(replyTo), MTP_inputMediaUploadedDocument(file, MTP_string(document->mime), _composeDocumentAttributes(document)), MTP_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), RPCFailHandlerPtr(), 0, 0, hist->sendRequestId); hist->sendRequestId = MTP::send(MTPmessages_SendMedia(MTP_int(sendFlags), item->history()->peer->input, MTP_int(replyTo), MTP_inputMediaUploadedDocument(file, MTP_string(document->mime), _composeDocumentAttributes(document)), MTP_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::sendMessageFail), 0, 0, hist->sendRequestId);
} }
} }
} }
@ -4549,7 +4549,7 @@ void HistoryWidget::onThumbDocumentUploaded(MsgId newId, const MTPInputFile &fil
if (replyTo) { if (replyTo) {
sendFlags |= MTPmessages_SendMedia::flag_reply_to_msg_id; sendFlags |= MTPmessages_SendMedia::flag_reply_to_msg_id;
} }
hist->sendRequestId = MTP::send(MTPmessages_SendMedia(MTP_int(sendFlags), item->history()->peer->input, MTP_int(replyTo), MTP_inputMediaUploadedThumbDocument(file, thumb, MTP_string(document->mime), _composeDocumentAttributes(document)), MTP_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), RPCFailHandlerPtr(), 0, 0, hist->sendRequestId); hist->sendRequestId = MTP::send(MTPmessages_SendMedia(MTP_int(sendFlags), item->history()->peer->input, MTP_int(replyTo), MTP_inputMediaUploadedThumbDocument(file, thumb, MTP_string(document->mime), _composeDocumentAttributes(document)), MTP_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::sendMessageFail), 0, 0, hist->sendRequestId);
} }
} }
} }
@ -4571,7 +4571,7 @@ void HistoryWidget::onAudioUploaded(MsgId newId, const MTPInputFile &file) {
if (replyTo) { if (replyTo) {
sendFlags |= MTPmessages_SendMedia::flag_reply_to_msg_id; sendFlags |= MTPmessages_SendMedia::flag_reply_to_msg_id;
} }
hist->sendRequestId = MTP::send(MTPmessages_SendMedia(MTP_int(sendFlags), item->history()->peer->input, MTP_int(replyTo), MTP_inputMediaUploadedAudio(file, MTP_int(audio->duration), MTP_string(audio->mime)), MTP_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), RPCFailHandlerPtr(), 0, 0, hist->sendRequestId); hist->sendRequestId = MTP::send(MTPmessages_SendMedia(MTP_int(sendFlags), item->history()->peer->input, MTP_int(replyTo), MTP_inputMediaUploadedAudio(file, MTP_int(audio->duration), MTP_string(audio->mime)), MTP_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::sendMessageFail), 0, 0, hist->sendRequestId);
} }
} }
} }
@ -5119,7 +5119,7 @@ void HistoryWidget::onStickerSend(DocumentData *sticker) {
} }
_history->addToBackDocument(newId, flags, replyToId(), date(MTP_int(unixtime())), MTP::authedId(), sticker); _history->addToBackDocument(newId, flags, replyToId(), date(MTP_int(unixtime())), MTP::authedId(), sticker);
_history->sendRequestId = MTP::send(MTPmessages_SendMedia(MTP_int(sendFlags), _peer->input, MTP_int(replyToId()), MTP_inputMediaDocument(MTP_inputDocument(MTP_long(sticker->id), MTP_long(sticker->access))), MTP_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), RPCFailHandlerPtr(), 0, 0, _history->sendRequestId); _history->sendRequestId = MTP::send(MTPmessages_SendMedia(MTP_int(sendFlags), _peer->input, MTP_int(replyToId()), MTP_inputMediaDocument(MTP_inputDocument(MTP_long(sticker->id), MTP_long(sticker->access))), MTP_long(randomId), MTPnullMarkup), App::main()->rpcDone(&MainWidget::sentUpdatesReceived), App::main()->rpcFail(&MainWidget::sendMessageFail), 0, 0, _history->sendRequestId);
App::main()->finishForwarding(_history); App::main()->finishForwarding(_history);
cancelReply(lastKeyboardUsed); cancelReply(lastKeyboardUsed);

View File

@ -822,6 +822,8 @@ bool MainWidget::addParticipantFail(UserData *user, const RPCError &error) {
text = lang(lng_failed_add_not_mutual); text = lang(lng_failed_add_not_mutual);
} else if (error.type() == "USER_ALREADY_PARTICIPANT" && user->botInfo) { } else if (error.type() == "USER_ALREADY_PARTICIPANT" && user->botInfo) {
text = lang(lng_bot_already_in_group); text = lang(lng_bot_already_in_group);
} else if (error.type() == "PEER_FLOOD") {
text = lang(lng_cant_invite_not_contact);
} }
App::wnd()->showLayer(new ConfirmBox(text, true)); App::wnd()->showLayer(new ConfirmBox(text, true));
return false; return false;
@ -877,7 +879,7 @@ void MainWidget::checkedHistory(PeerData *peer, const MTPmessages_Messages &resu
} }
} }
bool MainWidget::sendPhotoFailed(uint64 randomId, const RPCError &error) { bool MainWidget::sendPhotoFail(uint64 randomId, const RPCError &error) {
if (mtpIsFlood(error)) return false; if (mtpIsFlood(error)) return false;
if (error.type() == qsl("PHOTO_INVALID_DIMENSIONS")) { if (error.type() == qsl("PHOTO_INVALID_DIMENSIONS")) {
@ -891,6 +893,16 @@ bool MainWidget::sendPhotoFailed(uint64 randomId, const RPCError &error) {
_resendImgRandomIds.push_back(randomId); _resendImgRandomIds.push_back(randomId);
return true; return true;
} }
return sendMessageFail(error);
}
bool MainWidget::sendMessageFail(const RPCError &error) {
if (mtpIsFlood(error)) return false;
if (error.type() == qsl("PEER_FLOOD")) {
App::wnd()->showLayer(new ConfirmBox(lang(lng_cant_send_to_not_contact), true));
return true;
}
return false; return false;
} }
@ -1073,7 +1085,7 @@ void MainWidget::sendPreparedText(History *hist, const QString &text, MsgId repl
} }
MTPVector<MTPMessageEntity> localEntities = linksToMTP(textParseLinks(sendingText, itemTextParseOptions(hist, App::self()).flags)); MTPVector<MTPMessageEntity> localEntities = linksToMTP(textParseLinks(sendingText, itemTextParseOptions(hist, App::self()).flags));
hist->addToBack(MTP_message(MTP_int(flags), MTP_int(newId), MTP_int(MTP::authedId()), App::peerToMTP(hist->peer->id), MTPint(), MTPint(), MTP_int(replyTo), MTP_int(unixtime()), msgText, media, MTPnullMarkup, localEntities)); hist->addToBack(MTP_message(MTP_int(flags), MTP_int(newId), MTP_int(MTP::authedId()), App::peerToMTP(hist->peer->id), MTPint(), MTPint(), MTP_int(replyTo), MTP_int(unixtime()), msgText, media, MTPnullMarkup, localEntities));
hist->sendRequestId = MTP::send(MTPmessages_SendMessage(MTP_int(sendFlags), hist->peer->input, MTP_int(replyTo), msgText, MTP_long(randomId), MTPnullMarkup, localEntities), App::main()->rpcDone(&MainWidget::sentUpdatesReceived, randomId), RPCFailHandlerPtr(), 0, 0, hist->sendRequestId); hist->sendRequestId = MTP::send(MTPmessages_SendMessage(MTP_int(sendFlags), hist->peer->input, MTP_int(replyTo), msgText, MTP_long(randomId), MTPnullMarkup, localEntities), rpcDone(&MainWidget::sentUpdatesReceived, randomId), rpcFail(&MainWidget::sendMessageFail), 0, 0, hist->sendRequestId);
} }
finishForwarding(hist); finishForwarding(hist);
@ -3560,6 +3572,10 @@ void MainWidget::feedUpdate(const MTPUpdate &update) {
case mtpc_updateWebPage: { case mtpc_updateWebPage: {
const MTPDupdateWebPage &d(update.c_updateWebPage()); const MTPDupdateWebPage &d(update.c_updateWebPage());
if (!updPtsUpdated(d.vpts.v, d.vpts_count.v)) {
_byPtsUpdate.insert(ptsKey(SkippedUpdate), update);
return;
}
App::feedWebPage(d.vwebpage); App::feedWebPage(d.vwebpage);
history.updatePreview(); history.updatePreview();
webPagesUpdate(); webPagesUpdate();

View File

@ -300,7 +300,8 @@ public:
void checkPeerHistory(PeerData *peer); void checkPeerHistory(PeerData *peer);
void checkedHistory(PeerData *peer, const MTPmessages_Messages &result); void checkedHistory(PeerData *peer, const MTPmessages_Messages &result);
bool sendPhotoFailed(uint64 randomId, const RPCError &e); bool sendPhotoFail(uint64 randomId, const RPCError &e);
bool sendMessageFail(const RPCError &error);
void forwardSelectedItems(); void forwardSelectedItems();
void deleteSelectedItems(); void deleteSelectedItems();

View File

@ -2600,6 +2600,8 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP
} }
switch (stage) { switch (stage) {
case 0: to.add(" webpage: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 0: to.add(" webpage: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
case 1: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
case 2: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break;
} }
break; break;
@ -4709,6 +4711,19 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP
} }
break; break;
case mtpc_messages_reportSpam:
if (stage) {
to.add(",\n").addSpaces(lev);
} else {
to.add("{ messages_reportSpam");
to.add("\n").addSpaces(lev);
}
switch (stage) {
case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break;
}
break;
case mtpc_messages_discardEncryption: case mtpc_messages_discardEncryption:
if (stage) { if (stage) {
to.add(",\n").addSpaces(lev); to.add(",\n").addSpaces(lev);
@ -4777,19 +4792,6 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP
} }
break; break;
case mtpc_messages_reportSpam:
if (stage) {
to.add(",\n").addSpaces(lev);
} else {
to.add("{ messages_reportSpam");
to.add("\n").addSpaces(lev);
}
switch (stage) {
case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break;
}
break;
case mtpc_upload_saveFilePart: case mtpc_upload_saveFilePart:
if (stage) { if (stage) {
to.add(",\n").addSpaces(lev); to.add(",\n").addSpaces(lev);

View File

@ -243,7 +243,7 @@ enum {
mtpc_updateUserPhone = 0x12b9417b, mtpc_updateUserPhone = 0x12b9417b,
mtpc_updateReadHistoryInbox = 0x9961fd5c, mtpc_updateReadHistoryInbox = 0x9961fd5c,
mtpc_updateReadHistoryOutbox = 0x2f2f21bf, mtpc_updateReadHistoryOutbox = 0x2f2f21bf,
mtpc_updateWebPage = 0x2cc36971, mtpc_updateWebPage = 0x7f891213,
mtpc_updateReadMessagesContents = 0x68c13933, mtpc_updateReadMessagesContents = 0x68c13933,
mtpc_updates_state = 0xa56c2a3e, mtpc_updates_state = 0xa56c2a3e,
mtpc_updates_differenceEmpty = 0x5d75a138, mtpc_updates_differenceEmpty = 0x5d75a138,
@ -455,6 +455,7 @@ enum {
mtpc_messages_sendMessage = 0xfa88427a, mtpc_messages_sendMessage = 0xfa88427a,
mtpc_messages_sendMedia = 0xc8f16791, mtpc_messages_sendMedia = 0xc8f16791,
mtpc_messages_forwardMessages = 0x55e1728d, mtpc_messages_forwardMessages = 0x55e1728d,
mtpc_messages_reportSpam = 0xcf1592db,
mtpc_messages_getChats = 0x3c6aa187, mtpc_messages_getChats = 0x3c6aa187,
mtpc_messages_getFullChat = 0x3b831c66, mtpc_messages_getFullChat = 0x3b831c66,
mtpc_messages_editChatTitle = 0xdc452855, mtpc_messages_editChatTitle = 0xdc452855,
@ -485,7 +486,6 @@ enum {
mtpc_messages_installStickerSet = 0x7b30c3a6, mtpc_messages_installStickerSet = 0x7b30c3a6,
mtpc_messages_uninstallStickerSet = 0xf96e55de, mtpc_messages_uninstallStickerSet = 0xf96e55de,
mtpc_messages_startBot = 0x1b3e0ffc, mtpc_messages_startBot = 0x1b3e0ffc,
mtpc_messages_reportSpam = 0xcf1592db,
mtpc_updates_getState = 0xedd4882a, mtpc_updates_getState = 0xedd4882a,
mtpc_updates_getDifference = 0xa041495, mtpc_updates_getDifference = 0xa041495,
mtpc_photos_updateProfilePhoto = 0xeef579a0, mtpc_photos_updateProfilePhoto = 0xeef579a0,
@ -5133,7 +5133,7 @@ private:
friend MTPupdate MTP_updateUserPhone(MTPint _user_id, const MTPstring &_phone); friend MTPupdate MTP_updateUserPhone(MTPint _user_id, const MTPstring &_phone);
friend MTPupdate MTP_updateReadHistoryInbox(const MTPPeer &_peer, MTPint _max_id, MTPint _pts, MTPint _pts_count); friend MTPupdate MTP_updateReadHistoryInbox(const MTPPeer &_peer, MTPint _max_id, MTPint _pts, MTPint _pts_count);
friend MTPupdate MTP_updateReadHistoryOutbox(const MTPPeer &_peer, MTPint _max_id, MTPint _pts, MTPint _pts_count); friend MTPupdate MTP_updateReadHistoryOutbox(const MTPPeer &_peer, MTPint _max_id, MTPint _pts, MTPint _pts_count);
friend MTPupdate MTP_updateWebPage(const MTPWebPage &_webpage); friend MTPupdate MTP_updateWebPage(const MTPWebPage &_webpage, MTPint _pts, MTPint _pts_count);
friend MTPupdate MTP_updateReadMessagesContents(const MTPVector<MTPint> &_messages, MTPint _pts, MTPint _pts_count); friend MTPupdate MTP_updateReadMessagesContents(const MTPVector<MTPint> &_messages, MTPint _pts, MTPint _pts_count);
mtpTypeId _type; mtpTypeId _type;
@ -9755,10 +9755,12 @@ class MTPDupdateWebPage : public mtpDataImpl<MTPDupdateWebPage> {
public: public:
MTPDupdateWebPage() { MTPDupdateWebPage() {
} }
MTPDupdateWebPage(const MTPWebPage &_webpage) : vwebpage(_webpage) { MTPDupdateWebPage(const MTPWebPage &_webpage, MTPint _pts, MTPint _pts_count) : vwebpage(_webpage), vpts(_pts), vpts_count(_pts_count) {
} }
MTPWebPage vwebpage; MTPWebPage vwebpage;
MTPint vpts;
MTPint vpts_count;
}; };
class MTPDupdateReadMessagesContents : public mtpDataImpl<MTPDupdateReadMessagesContents> { class MTPDupdateReadMessagesContents : public mtpDataImpl<MTPDupdateReadMessagesContents> {
@ -14406,6 +14408,45 @@ public:
} }
}; };
class MTPmessages_reportSpam { // RPC method 'messages.reportSpam'
public:
MTPInputPeer vpeer;
MTPmessages_reportSpam() {
}
MTPmessages_reportSpam(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_reportSpam) {
read(from, end, cons);
}
MTPmessages_reportSpam(const MTPInputPeer &_peer) : vpeer(_peer) {
}
uint32 innerLength() const {
return vpeer.innerLength();
}
mtpTypeId type() const {
return mtpc_messages_reportSpam;
}
void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_reportSpam) {
vpeer.read(from, end);
}
void write(mtpBuffer &to) const {
vpeer.write(to);
}
typedef MTPBool ResponseType;
};
class MTPmessages_ReportSpam : public MTPBoxed<MTPmessages_reportSpam> {
public:
MTPmessages_ReportSpam() {
}
MTPmessages_ReportSpam(const MTPmessages_reportSpam &v) : MTPBoxed<MTPmessages_reportSpam>(v) {
}
MTPmessages_ReportSpam(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed<MTPmessages_reportSpam>(from, end, cons) {
}
MTPmessages_ReportSpam(const MTPInputPeer &_peer) : MTPBoxed<MTPmessages_reportSpam>(MTPmessages_reportSpam(_peer)) {
}
};
class MTPmessages_getChats { // RPC method 'messages.getChats' class MTPmessages_getChats { // RPC method 'messages.getChats'
public: public:
MTPVector<MTPint> vid; MTPVector<MTPint> vid;
@ -15666,45 +15707,6 @@ public:
} }
}; };
class MTPmessages_reportSpam { // RPC method 'messages.reportSpam'
public:
MTPInputPeer vpeer;
MTPmessages_reportSpam() {
}
MTPmessages_reportSpam(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_reportSpam) {
read(from, end, cons);
}
MTPmessages_reportSpam(const MTPInputPeer &_peer) : vpeer(_peer) {
}
uint32 innerLength() const {
return vpeer.innerLength();
}
mtpTypeId type() const {
return mtpc_messages_reportSpam;
}
void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_reportSpam) {
vpeer.read(from, end);
}
void write(mtpBuffer &to) const {
vpeer.write(to);
}
typedef MTPBool ResponseType;
};
class MTPmessages_ReportSpam : public MTPBoxed<MTPmessages_reportSpam> {
public:
MTPmessages_ReportSpam() {
}
MTPmessages_ReportSpam(const MTPmessages_reportSpam &v) : MTPBoxed<MTPmessages_reportSpam>(v) {
}
MTPmessages_ReportSpam(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed<MTPmessages_reportSpam>(from, end, cons) {
}
MTPmessages_ReportSpam(const MTPInputPeer &_peer) : MTPBoxed<MTPmessages_reportSpam>(MTPmessages_reportSpam(_peer)) {
}
};
class MTPupdates_getState { // RPC method 'updates.getState' class MTPupdates_getState { // RPC method 'updates.getState'
public: public:
MTPupdates_getState() { MTPupdates_getState() {
@ -21082,7 +21084,7 @@ inline uint32 MTPupdate::innerLength() const {
} }
case mtpc_updateWebPage: { case mtpc_updateWebPage: {
const MTPDupdateWebPage &v(c_updateWebPage()); const MTPDupdateWebPage &v(c_updateWebPage());
return v.vwebpage.innerLength(); return v.vwebpage.innerLength() + v.vpts.innerLength() + v.vpts_count.innerLength();
} }
case mtpc_updateReadMessagesContents: { case mtpc_updateReadMessagesContents: {
const MTPDupdateReadMessagesContents &v(c_updateReadMessagesContents()); const MTPDupdateReadMessagesContents &v(c_updateReadMessagesContents());
@ -21276,6 +21278,8 @@ inline void MTPupdate::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeI
if (!data) setData(new MTPDupdateWebPage()); if (!data) setData(new MTPDupdateWebPage());
MTPDupdateWebPage &v(_updateWebPage()); MTPDupdateWebPage &v(_updateWebPage());
v.vwebpage.read(from, end); v.vwebpage.read(from, end);
v.vpts.read(from, end);
v.vpts_count.read(from, end);
} break; } break;
case mtpc_updateReadMessagesContents: _type = cons; { case mtpc_updateReadMessagesContents: _type = cons; {
if (!data) setData(new MTPDupdateReadMessagesContents()); if (!data) setData(new MTPDupdateReadMessagesContents());
@ -21440,6 +21444,8 @@ inline void MTPupdate::write(mtpBuffer &to) const {
case mtpc_updateWebPage: { case mtpc_updateWebPage: {
const MTPDupdateWebPage &v(c_updateWebPage()); const MTPDupdateWebPage &v(c_updateWebPage());
v.vwebpage.write(to); v.vwebpage.write(to);
v.vpts.write(to);
v.vpts_count.write(to);
} break; } break;
case mtpc_updateReadMessagesContents: { case mtpc_updateReadMessagesContents: {
const MTPDupdateReadMessagesContents &v(c_updateReadMessagesContents()); const MTPDupdateReadMessagesContents &v(c_updateReadMessagesContents());
@ -21616,8 +21622,8 @@ inline MTPupdate MTP_updateReadHistoryInbox(const MTPPeer &_peer, MTPint _max_id
inline MTPupdate MTP_updateReadHistoryOutbox(const MTPPeer &_peer, MTPint _max_id, MTPint _pts, MTPint _pts_count) { inline MTPupdate MTP_updateReadHistoryOutbox(const MTPPeer &_peer, MTPint _max_id, MTPint _pts, MTPint _pts_count) {
return MTPupdate(new MTPDupdateReadHistoryOutbox(_peer, _max_id, _pts, _pts_count)); return MTPupdate(new MTPDupdateReadHistoryOutbox(_peer, _max_id, _pts, _pts_count));
} }
inline MTPupdate MTP_updateWebPage(const MTPWebPage &_webpage) { inline MTPupdate MTP_updateWebPage(const MTPWebPage &_webpage, MTPint _pts, MTPint _pts_count) {
return MTPupdate(new MTPDupdateWebPage(_webpage)); return MTPupdate(new MTPDupdateWebPage(_webpage, _pts, _pts_count));
} }
inline MTPupdate MTP_updateReadMessagesContents(const MTPVector<MTPint> &_messages, MTPint _pts, MTPint _pts_count) { inline MTPupdate MTP_updateReadMessagesContents(const MTPVector<MTPint> &_messages, MTPint _pts, MTPint _pts_count) {
return MTPupdate(new MTPDupdateReadMessagesContents(_messages, _pts, _pts_count)); return MTPupdate(new MTPDupdateReadMessagesContents(_messages, _pts, _pts_count));

View File

@ -126,6 +126,7 @@ register.saveDeveloperInfo#9a5f6e95 name:string email:string phone_number:string
---types--- ---types---
error#c4b9f9bb code:int text:string = Error; error#c4b9f9bb code:int text:string = Error;
null#56730bcc = Null; null#56730bcc = Null;
@ -366,7 +367,7 @@ updatePrivacy#ee3b272a key:PrivacyKey rules:Vector<PrivacyRule> = Update;
updateUserPhone#12b9417b user_id:int phone:string = Update; updateUserPhone#12b9417b user_id:int phone:string = Update;
updateReadHistoryInbox#9961fd5c peer:Peer max_id:int pts:int pts_count:int = Update; updateReadHistoryInbox#9961fd5c peer:Peer max_id:int pts:int pts_count:int = Update;
updateReadHistoryOutbox#2f2f21bf peer:Peer max_id:int pts:int pts_count:int = Update; updateReadHistoryOutbox#2f2f21bf peer:Peer max_id:int pts:int pts_count:int = Update;
updateWebPage#2cc36971 webpage:WebPage = Update; updateWebPage#7f891213 webpage:WebPage pts:int pts_count:int = Update;
updateReadMessagesContents#68c13933 messages:Vector<int> pts:int pts_count:int = Update; updateReadMessagesContents#68c13933 messages:Vector<int> pts:int pts_count:int = Update;
updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State; updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
@ -647,6 +648,7 @@ messages.setTyping#a3825e50 peer:InputPeer action:SendMessageAction = Bool;
messages.sendMessage#fa88427a flags:# peer:InputPeer reply_to_msg_id:flags.0?int message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> = Updates; messages.sendMessage#fa88427a flags:# peer:InputPeer reply_to_msg_id:flags.0?int message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector<MessageEntity> = Updates;
messages.sendMedia#c8f16791 flags:# peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia random_id:long reply_markup:flags.2?ReplyMarkup = Updates; messages.sendMedia#c8f16791 flags:# peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia random_id:long reply_markup:flags.2?ReplyMarkup = Updates;
messages.forwardMessages#55e1728d peer:InputPeer id:Vector<int> random_id:Vector<long> = Updates; messages.forwardMessages#55e1728d peer:InputPeer id:Vector<int> random_id:Vector<long> = Updates;
messages.reportSpam#cf1592db peer:InputPeer = Bool;
messages.getChats#3c6aa187 id:Vector<int> = messages.Chats; messages.getChats#3c6aa187 id:Vector<int> = messages.Chats;
messages.getFullChat#3b831c66 chat_id:int = messages.ChatFull; messages.getFullChat#3b831c66 chat_id:int = messages.ChatFull;
messages.editChatTitle#dc452855 chat_id:int title:string = Updates; messages.editChatTitle#dc452855 chat_id:int title:string = Updates;
@ -677,7 +679,6 @@ messages.getStickerSet#2619a90e stickerset:InputStickerSet = messages.StickerSet
messages.installStickerSet#7b30c3a6 stickerset:InputStickerSet disabled:Bool = Bool; messages.installStickerSet#7b30c3a6 stickerset:InputStickerSet disabled:Bool = Bool;
messages.uninstallStickerSet#f96e55de stickerset:InputStickerSet = Bool; messages.uninstallStickerSet#f96e55de stickerset:InputStickerSet = Bool;
messages.startBot#1b3e0ffc bot:InputUser chat_id:int random_id:long start_param:string = Updates; messages.startBot#1b3e0ffc bot:InputUser chat_id:int random_id:long start_param:string = Updates;
messages.reportSpam#cf1592db peer:InputPeer = Bool;
updates.getState#edd4882a = updates.State; updates.getState#edd4882a = updates.State;
updates.getDifference#a041495 pts:int date:int qts:int = updates.Difference; updates.getDifference#a041495 pts:int date:int qts:int = updates.Difference;