mirror of https://github.com/procxx/kepka.git
moved to 40 layer
This commit is contained in:
parent
3edc46320d
commit
4b8a33de1c
|
@ -316,7 +316,7 @@ void ApiWrap::gotUserFull(PeerData *peer, const MTPUserFull &result) {
|
|||
App::main()->gotNotifySetting(MTP_inputNotifyPeer(peer->input), d.vnotify_settings);
|
||||
|
||||
peer->asUser()->setBotInfo(d.vbot_info);
|
||||
peer->asUser()->blocked = d.vblocked.v ? UserIsBlocked : UserIsNotBlocked;
|
||||
peer->asUser()->blocked = mtpIsTrue(d.vblocked) ? UserIsBlocked : UserIsNotBlocked;
|
||||
|
||||
_fullPeerRequests.remove(peer);
|
||||
App::clearPeerUpdated(peer);
|
||||
|
@ -502,7 +502,7 @@ void ApiWrap::gotStickerSet(uint64 setId, const MTPmessages_StickerSet &result)
|
|||
it->hash = s.vhash.v;
|
||||
it->shortName = qs(s.vshort_name);
|
||||
QString title = qs(s.vtitle);
|
||||
if ((it->flags & MTPDstickerSet_flag_official) && !title.compare(qstr("Great Minds"), Qt::CaseInsensitive)) {
|
||||
if ((it->flags & MTPDstickerSet::flag_official) && !title.compare(qstr("Great Minds"), Qt::CaseInsensitive)) {
|
||||
title = lang(lng_stickers_default_set);
|
||||
}
|
||||
it->title = title;
|
||||
|
|
|
@ -383,7 +383,7 @@ namespace App {
|
|||
PeerId peer(peerFromUser(d.vid.v));
|
||||
data = App::user(peer);
|
||||
int32 flags = d.vflags.v;
|
||||
if (flags & MTPDuser_flag_self) {
|
||||
if (d.is_self()) {
|
||||
data->input = MTP_inputPeerSelf();
|
||||
data->inputUser = MTP_inputUserSelf();
|
||||
} else if (!d.has_access_hash()) {
|
||||
|
@ -393,7 +393,7 @@ namespace App {
|
|||
data->input = MTP_inputPeerUser(d.vid, d.vaccess_hash);
|
||||
data->inputUser = MTP_inputUser(d.vid, d.vaccess_hash);
|
||||
}
|
||||
if (flags & MTPDuser_flag_deleted) {
|
||||
if (d.is_deleted()) {
|
||||
data->setPhone(QString());
|
||||
data->setName(lang(lng_deleted), QString(), QString(), QString());
|
||||
data->setPhoto(MTP_userProfilePhotoEmpty());
|
||||
|
@ -410,8 +410,8 @@ namespace App {
|
|||
|
||||
bool nameChanged = (data->firstName != fname) || (data->lastName != lname);
|
||||
|
||||
bool showPhone = !isServiceUser(data->id) && !(flags & (MTPDuser_flag_self | MTPDuser_flag_contact | MTPDuser_flag_mutual_contact));
|
||||
bool showPhoneChanged = !isServiceUser(data->id) && !(flags & (MTPDuser_flag_self)) && ((showPhone && data->contact) || (!showPhone && !data->contact));
|
||||
bool showPhone = !isServiceUser(data->id) && !d.is_self() && !d.is_contact() && !d.is_mutual_contact();
|
||||
bool showPhoneChanged = !isServiceUser(data->id) && !d.is_self() && ((showPhone && data->contact) || (!showPhone && !data->contact));
|
||||
|
||||
// see also Local::readPeer
|
||||
|
||||
|
@ -429,17 +429,17 @@ namespace App {
|
|||
wasContact = (data->contact > 0);
|
||||
if (d.has_bot_info_version()) {
|
||||
data->setBotInfoVersion(d.vbot_info_version.v);
|
||||
data->botInfo->readsAllHistory = (d.vflags.v & MTPDuser_flag_bot_reads_all);
|
||||
data->botInfo->cantJoinGroups = (d.vflags.v & MTPDuser_flag_bot_cant_join);
|
||||
data->botInfo->readsAllHistory = d.is_bot_chat_history();
|
||||
data->botInfo->cantJoinGroups = d.is_bot_nochats();
|
||||
} else {
|
||||
data->setBotInfoVersion(-1);
|
||||
}
|
||||
data->contact = (flags & (MTPDuser_flag_contact | MTPDuser_flag_mutual_contact)) ? 1 : (data->phone.isEmpty() ? -1 : 0);
|
||||
data->contact = (d.is_contact() || d.is_mutual_contact()) ? 1 : (data->phone.isEmpty() ? -1 : 0);
|
||||
if (data->contact == 1 && cReportSpamStatuses().value(data->id, dbiprsNoButton) != dbiprsNoButton) {
|
||||
cRefReportSpamStatuses().insert(data->id, dbiprsNoButton);
|
||||
Local::writeReportSpamStatuses();
|
||||
}
|
||||
if ((flags & MTPDuser_flag_self) && ::self != data) {
|
||||
if (d.is_self() && ::self != data) {
|
||||
::self = data;
|
||||
if (App::wnd()) App::wnd()->updateGlobalMenu();
|
||||
}
|
||||
|
@ -502,8 +502,8 @@ namespace App {
|
|||
cdata->setPhoto(d.vphoto);
|
||||
cdata->date = d.vdate.v;
|
||||
cdata->count = d.vparticipants_count.v;
|
||||
cdata->isForbidden = (d.vflags.v & MTPDchat_flag_kicked);
|
||||
cdata->haveLeft = (d.vflags.v & MTPDchat_flag_left);
|
||||
cdata->isForbidden = d.is_kicked();
|
||||
cdata->haveLeft = d.is_left();
|
||||
if (cdata->version < d.vversion.v) {
|
||||
cdata->version = d.vversion.v;
|
||||
cdata->participants = ChatData::Participants();
|
||||
|
|
|
@ -500,7 +500,7 @@ void GroupInfoBox::onNext() {
|
|||
if (_creating == CreatingGroupGroup) {
|
||||
App::wnd()->replaceLayer(new ContactsBox(title, _photoBig));
|
||||
} else {
|
||||
_creationRequestId = MTP::send(MTPchannels_CreateChannel(MTP_int(MTPmessages_CreateChannel_flag_broadcast), MTP_string(title), MTP_string(description), MTP_vector<MTPInputUser>(0)), rpcDone(&GroupInfoBox::creationDone), rpcFail(&GroupInfoBox::creationFail));
|
||||
_creationRequestId = MTP::send(MTPchannels_CreateChannel(MTP_int(MTPchannels_CreateChannel::flag_broadcast), MTP_string(title), MTP_string(description), MTP_vector<MTPInputUser>(0)), rpcDone(&GroupInfoBox::creationDone), rpcFail(&GroupInfoBox::creationFail));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -918,7 +918,7 @@ bool SetupChannelBox::onUpdateFail(const RPCError &error) {
|
|||
|
||||
void SetupChannelBox::onCheckDone(const MTPBool &result) {
|
||||
_checkRequestId = 0;
|
||||
QString newError = (result.v || _checkUsername == _channel->username) ? QString() : lang(lng_create_channel_link_occupied);
|
||||
QString newError = (mtpIsTrue(result) || _checkUsername == _channel->username) ? QString() : lang(lng_create_channel_link_occupied);
|
||||
QString newGood = newError.isEmpty() ? lang(lng_create_channel_link_available) : QString();
|
||||
if (_errorText != newError || _goodText != newGood) {
|
||||
_errorText = newError;
|
||||
|
|
|
@ -97,7 +97,7 @@ void StickerSetInner::installDone(const MTPBool &result) {
|
|||
StickerSetsOrder &order(cRefStickerSetsOrder());
|
||||
for (int32 s = order.size(); insertAtIndex < s; ++insertAtIndex) {
|
||||
StickerSets::const_iterator i = sets.constFind(order.at(insertAtIndex));
|
||||
if (i == sets.cend() || !(i->flags & MTPDstickerSet_flag_official)) {
|
||||
if (i == sets.cend() || !(i->flags & MTPDstickerSet::flag_official)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -231,7 +231,7 @@ bool UsernameBox::onUpdateFail(const RPCError &error) {
|
|||
|
||||
void UsernameBox::onCheckDone(const MTPBool &result) {
|
||||
_checkRequestId = 0;
|
||||
QString newError = (result.v || _checkUsername == App::self()->username) ? QString() : lang(lng_username_occupied);
|
||||
QString newError = (mtpIsTrue(result) || _checkUsername == App::self()->username) ? QString() : lang(lng_username_occupied);
|
||||
QString newGood = newError.isEmpty() ? lang(lng_username_available) : QString();
|
||||
if (_errorText != newError || _goodText != newGood || !_copiedTextLink.isEmpty()) {
|
||||
_errorText = newError;
|
||||
|
|
|
@ -1771,7 +1771,7 @@ bool DialogsWidget::onSearchMessages(bool searchCache) {
|
|||
} else if (_searchQuery != q) {
|
||||
_searchQuery = q;
|
||||
_searchFull = false;
|
||||
int32 flags = (_searchInPeer && _searchInPeer->isChannel()) ? MTPmessages_Search_flag_only_important : 0;
|
||||
int32 flags = (_searchInPeer && _searchInPeer->isChannel()) ? MTPmessages_Search::flag_important_only : 0;
|
||||
if (_searchRequest) {
|
||||
MTP::cancel(_searchRequest);
|
||||
}
|
||||
|
@ -1825,7 +1825,7 @@ void DialogsWidget::searchMessages(const QString &query, PeerData *inPeer) {
|
|||
|
||||
void DialogsWidget::onSearchMore(MsgId minMsgId) {
|
||||
if (!_searchRequest && !_searchFull) {
|
||||
int32 flags = (_searchInPeer && _searchInPeer->isChannel()) ? MTPmessages_Search_flag_only_important : 0;
|
||||
int32 flags = (_searchInPeer && _searchInPeer->isChannel()) ? MTPmessages_Search::flag_important_only : 0;
|
||||
_searchRequest = MTP::send(MTPmessages_Search(MTP_int(flags), _searchInPeer ? _searchInPeer->input : MTP_inputPeerEmpty(), MTP_string(_searchQuery), MTP_inputMessagesFilterEmpty(), MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(minMsgId), MTP_int(SearchPerPage)), rpcDone(&DialogsWidget::searchReceived, !minMsgId), rpcFail(&DialogsWidget::searchFailed));
|
||||
if (!minMsgId) {
|
||||
_searchQueries.insert(_searchRequest, _searchQuery);
|
||||
|
|
|
@ -1272,7 +1272,7 @@ void StickerPanInner::paintEvent(QPaintEvent *e) {
|
|||
tilly = y + st::emojiPanHeader + (rows * st::stickerPanSize.height());
|
||||
if (r.top() >= tilly) continue;
|
||||
|
||||
bool special = (_sets[c].flags & MTPDstickerSet_flag_official);
|
||||
bool special = (_sets[c].flags & MTPDstickerSet::flag_official);
|
||||
y += st::emojiPanHeader;
|
||||
|
||||
int32 fromrow = floorclamp(r.y() - y, st::stickerPanSize.height(), 0, rows);
|
||||
|
@ -1552,7 +1552,7 @@ void StickerPanInner::refreshRecent(bool performResize) {
|
|||
}
|
||||
}
|
||||
if (_sets.isEmpty() || _sets.at(0).id != RecentStickerSetId) {
|
||||
_sets.push_back(DisplayedSet(RecentStickerSetId, MTPDstickerSet_flag_official, lang(lng_emoji_category0), recent.size() * 2, recent));
|
||||
_sets.push_back(DisplayedSet(RecentStickerSetId, MTPDstickerSet::flag_official, lang(lng_emoji_category0), recent.size() * 2, recent));
|
||||
} else {
|
||||
_sets[0].pack = recent;
|
||||
_sets[0].hovers.resize(recent.size() * 2);
|
||||
|
@ -1606,7 +1606,7 @@ void StickerPanInner::fillPanels(QVector<EmojiPanel*> &panels) {
|
|||
int y = 0;
|
||||
panels.reserve(_sets.size());
|
||||
for (int32 i = 0, l = _sets.size(); i < l; ++i) {
|
||||
bool special = (_sets.at(i).flags & MTPDstickerSet_flag_official);
|
||||
bool special = (_sets.at(i).flags & MTPDstickerSet::flag_official);
|
||||
panels.push_back(new EmojiPanel(parentWidget(), _sets.at(i).title, _sets.at(i).id, special, y));
|
||||
panels.back()->show();
|
||||
connect(panels.back(), SIGNAL(deleteClicked(quint64)), this, SIGNAL(removing(quint64)));
|
||||
|
@ -1639,7 +1639,7 @@ void StickerPanInner::updateSelected() {
|
|||
for (int c = 0, l = _sets.size(); c < l; ++c) {
|
||||
const DisplayedSet &set(_sets.at(c));
|
||||
int cnt = set.pack.size();
|
||||
bool special = (set.flags & MTPDstickerSet_flag_official);
|
||||
bool special = (set.flags & MTPDstickerSet::flag_official);
|
||||
|
||||
y = ytill;
|
||||
ytill = y + st::emojiPanHeader + ((cnt / StickerPanPerRow) + ((cnt % StickerPanPerRow) ? 1 : 0)) * st::stickerPanSize.height();
|
||||
|
@ -2615,7 +2615,7 @@ void EmojiPan::onSwitch() {
|
|||
|
||||
void EmojiPan::onRemoveSet(quint64 setId) {
|
||||
StickerSets::const_iterator it = cStickerSets().constFind(setId);
|
||||
if (it != cStickerSets().cend() && !(it->flags & MTPDstickerSet_flag_official)) {
|
||||
if (it != cStickerSets().cend() && !(it->flags & MTPDstickerSet::flag_official)) {
|
||||
_removingSetId = it->id;
|
||||
ConfirmBox *box = new ConfirmBox(lng_stickers_remove_pack(lt_sticker_pack, it->title), lang(lng_box_remove));
|
||||
connect(box, SIGNAL(confirmed()), this, SLOT(onRemoveSetSure()));
|
||||
|
@ -2627,7 +2627,7 @@ void EmojiPan::onRemoveSet(quint64 setId) {
|
|||
void EmojiPan::onRemoveSetSure() {
|
||||
App::wnd()->hideLayer();
|
||||
StickerSets::iterator it = cRefStickerSets().find(_removingSetId);
|
||||
if (it != cRefStickerSets().cend() && !(it->flags & MTPDstickerSet_flag_official)) {
|
||||
if (it != cRefStickerSets().cend() && !(it->flags & MTPDstickerSet::flag_official)) {
|
||||
if (it->id && it->access) {
|
||||
MTP::send(MTPmessages_UninstallStickerSet(MTP_inputStickerSetID(MTP_long(it->id), MTP_long(it->access))));
|
||||
} else if (!it->shortName.isEmpty()) {
|
||||
|
|
|
@ -262,7 +262,7 @@ void FileUploader::partLoaded(const MTPBool &result, mtpRequestId requestId) {
|
|||
j = docRequestsSent.find(requestId);
|
||||
}
|
||||
if (i != requestsSent.cend() || j != docRequestsSent.cend()) {
|
||||
if (!result.v) { // failed to upload current file
|
||||
if (mtpIsFalse(result)) { // failed to upload current file
|
||||
currentFailed();
|
||||
return;
|
||||
} else {
|
||||
|
|
|
@ -686,7 +686,7 @@ HistoryJoined *ChannelHistory::insertJoinedMessage(bool unread) {
|
|||
if (!inviter) return 0;
|
||||
|
||||
if (peerToUser(inviter->id) == MTP::authedId()) unread = false;
|
||||
int32 flags = (unread ? MTPDmessage_flag_unread : 0);
|
||||
int32 flags = (unread ? MTPDmessage::flag_unread : 0);
|
||||
QDateTime inviteDate = peer->asChannel()->inviteDate;
|
||||
if (unread) _maxReadMessageDate = inviteDate;
|
||||
if (isEmpty()) {
|
||||
|
@ -1698,7 +1698,7 @@ HistoryItem *History::addNewItem(HistoryBlock *to, bool newBlock, HistoryItem *a
|
|||
}
|
||||
if (adding->hasReplyMarkup()) {
|
||||
int32 markupFlags = App::replyMarkup(channelId(), adding->id).flags;
|
||||
if (!(markupFlags & MTPDreplyKeyboardMarkup_flag_personal) || adding->notifyByFrom()) {
|
||||
if (!(markupFlags & MTPDreplyKeyboardMarkup::flag_selective) || adding->mentionsMe()) {
|
||||
if (peer->isChat()) {
|
||||
peer->asChat()->markupSenders.insert(adding->from(), true);
|
||||
}
|
||||
|
@ -1907,7 +1907,7 @@ void History::addOlderSlice(const QVector<MTPMessage> &slice, const QVector<MTPM
|
|||
}
|
||||
if (!lastKeyboardInited && item->hasReplyMarkup() && !item->out()) { // chats with bots
|
||||
int32 markupFlags = App::replyMarkup(channelId(), item->id).flags;
|
||||
if (!(markupFlags & MTPDreplyKeyboardMarkup_flag_personal) || item->notifyByFrom()) {
|
||||
if (!(markupFlags & MTPDreplyKeyboardMarkup::flag_selective) || item->mentionsMe()) {
|
||||
bool wasKeyboardHide = peer->asChat()->markupSenders.contains(item->from());
|
||||
if (!wasKeyboardHide) {
|
||||
peer->asChat()->markupSenders.insert(item->from(), true);
|
||||
|
@ -1928,7 +1928,7 @@ void History::addOlderSlice(const QVector<MTPMessage> &slice, const QVector<MTPM
|
|||
}
|
||||
} else if (!lastKeyboardInited && item->hasReplyMarkup() && !item->out()) { // conversations with bots
|
||||
int32 markupFlags = App::replyMarkup(channelId(), item->id).flags;
|
||||
if (!(markupFlags & MTPDreplyKeyboardMarkup_flag_personal) || item->notifyByFrom()) {
|
||||
if (!(markupFlags & MTPDreplyKeyboardMarkup::flag_selective) || item->mentionsMe()) {
|
||||
if (markupFlags & MTPDreplyKeyboardMarkup_flag_ZERO) {
|
||||
clearLastKeyboard();
|
||||
} else {
|
||||
|
@ -6778,7 +6778,7 @@ HistoryForwarded::HistoryForwarded(History *history, HistoryBlock *block, const
|
|||
fwdNameUpdated();
|
||||
}
|
||||
|
||||
HistoryForwarded::HistoryForwarded(History *history, HistoryBlock *block, MsgId id, QDateTime date, int32 from, HistoryMessage *msg) : HistoryMessage(history, block, id, newMessageFlags(history->peer) | (!history->peer->isChannel() && msg->getMedia() && (msg->getMedia()->type() == MediaTypeAudio/* || msg->getMedia()->type() == MediaTypeVideo*/) ? MTPDmessage_flag_media_unread : 0), date, from, msg->HistoryMessage::originalText(), msg->HistoryMessage::originalEntities(), msg->getMedia())
|
||||
HistoryForwarded::HistoryForwarded(History *history, HistoryBlock *block, MsgId id, QDateTime date, int32 from, HistoryMessage *msg) : HistoryMessage(history, block, id, newMessageFlags(history->peer) | (!history->peer->isChannel() && msg->getMedia() && (msg->getMedia()->type() == MediaTypeAudio/* || msg->getMedia()->type() == MediaTypeVideo*/) ? MTPDmessage::flag_media_unread : 0), date, from, msg->HistoryMessage::originalText(), msg->HistoryMessage::originalEntities(), msg->getMedia())
|
||||
, fwdDate(msg->dateForwarded())
|
||||
, fwdFrom(msg->fromForwarded())
|
||||
, fwdFromVersion(fwdFrom->nameVersion)
|
||||
|
|
|
@ -780,7 +780,7 @@ enum InfoDisplayType {
|
|||
};
|
||||
|
||||
inline bool isImportantChannelMessage(MsgId id, int32 flags) { // client-side important msgs always has_views or has_from_id
|
||||
return (flags & MTPDmessage_flag_out) || (flags & MTPDmessage_flag_notify_by_from) || ((id > 0 || flags != 0) && !(flags & MTPDmessage::flag_from_id));
|
||||
return (flags & MTPDmessage::flag_out) || (flags & MTPDmessage::flag_mentioned) || ((id > 0 || flags != 0) && !(flags & MTPDmessage::flag_from_id));
|
||||
}
|
||||
|
||||
enum HistoryItemType {
|
||||
|
@ -827,20 +827,20 @@ public:
|
|||
_block = block;
|
||||
}
|
||||
bool out() const {
|
||||
return _flags & MTPDmessage_flag_out;
|
||||
return _flags & MTPDmessage::flag_out;
|
||||
}
|
||||
bool unread() const {
|
||||
if ((out() && (id > 0 && id < _history->outboxReadBefore)) || (!out() && id > 0 && id < _history->inboxReadBefore)) return false;
|
||||
return (id > 0 && !out() && channelId() != NoChannel) ? true : (history()->peer->isSelf() ? false : (_flags & MTPDmessage_flag_unread));
|
||||
return (id > 0 && !out() && channelId() != NoChannel) ? true : (history()->peer->isSelf() ? false : (_flags & MTPDmessage::flag_unread));
|
||||
}
|
||||
bool notifyByFrom() const {
|
||||
return _flags & MTPDmessage_flag_notify_by_from;
|
||||
bool mentionsMe() const {
|
||||
return _flags & MTPDmessage::flag_mentioned;
|
||||
}
|
||||
bool isMediaUnread() const {
|
||||
return (_flags & MTPDmessage_flag_media_unread) && (channelId() == NoChannel);
|
||||
return (_flags & MTPDmessage::flag_media_unread) && (channelId() == NoChannel);
|
||||
}
|
||||
void markMediaRead() {
|
||||
_flags &= ~MTPDmessage_flag_media_unread;
|
||||
_flags &= ~MTPDmessage::flag_media_unread;
|
||||
}
|
||||
bool hasReplyMarkup() const {
|
||||
return _flags & MTPDmessage::flag_reply_markup;
|
||||
|
|
|
@ -1883,8 +1883,8 @@ bool BotKeyboard::updateMarkup(HistoryItem *to) {
|
|||
_btns.clear();
|
||||
const ReplyMarkup &markup(App::replyMarkup(to->channelId(), to->id));
|
||||
_forceReply = markup.flags & MTPDreplyKeyboardMarkup_flag_FORCE_REPLY;
|
||||
_maximizeSize = !(markup.flags & MTPDreplyKeyboardMarkup_flag_resize);
|
||||
_singleUse = _forceReply || (markup.flags & MTPDreplyKeyboardMarkup_flag_single_use);
|
||||
_maximizeSize = !(markup.flags & MTPDreplyKeyboardMarkup::flag_resize);
|
||||
_singleUse = _forceReply || (markup.flags & MTPDreplyKeyboardMarkup::flag_single_use);
|
||||
|
||||
const ReplyMarkup::Commands &commands(markup.commands);
|
||||
if (!commands.isEmpty()) {
|
||||
|
@ -2767,7 +2767,7 @@ void HistoryWidget::stickersGot(const MTPmessages_AllStickers &stickers) {
|
|||
const MTPDstickerSet &set(d_sets.at(i).c_stickerSet());
|
||||
StickerSets::iterator i = sets.find(set.vid.v);
|
||||
QString title = qs(set.vtitle);
|
||||
if (set.vflags.v & MTPDstickerSet_flag_official) {
|
||||
if (set.vflags.v & MTPDstickerSet::flag_official) {
|
||||
if (!title.compare(qstr("Great Minds"), Qt::CaseInsensitive)) {
|
||||
title = lang(lng_stickers_default_set);
|
||||
}
|
||||
|
@ -2778,7 +2778,7 @@ void HistoryWidget::stickersGot(const MTPmessages_AllStickers &stickers) {
|
|||
|
||||
if (i == sets.cend()) {
|
||||
i = sets.insert(set.vid.v, StickerSet(set.vid.v, set.vaccess_hash.v, title, qs(set.vshort_name), set.vcount.v, set.vhash.v, set.vflags.v | MTPDstickerSet_flag_NOT_LOADED));
|
||||
if (!(i->flags & MTPDstickerSet_flag_disabled)) {
|
||||
if (!(i->flags & MTPDstickerSet::flag_disabled)) {
|
||||
setsToRequest.insert(set.vid.v, set.vaccess_hash.v);
|
||||
}
|
||||
} else {
|
||||
|
@ -2790,7 +2790,7 @@ void HistoryWidget::stickersGot(const MTPmessages_AllStickers &stickers) {
|
|||
i->count = set.vcount.v;
|
||||
i->hash = set.vhash.v;
|
||||
i->flags |= MTPDstickerSet_flag_NOT_LOADED; // need to request this set
|
||||
if (!(i->flags & MTPDstickerSet_flag_disabled)) {
|
||||
if (!(i->flags & MTPDstickerSet::flag_disabled)) {
|
||||
setsToRequest.insert(set.vid.v, set.vaccess_hash.v);
|
||||
}
|
||||
}
|
||||
|
@ -4888,7 +4888,7 @@ void HistoryWidget::confirmSendFile(const FileLoadResultPtr &file, bool ctrlShif
|
|||
h->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(fromChannelName ? 0 : MTP::authedId()), peerToMTP(file->to.peer), MTPPeer(), MTPint(), MTP_int(file->to.replyTo), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaDocument(file->document), MTPnullMarkup, MTPnullEntities, MTP_int(1)), NewMessageUnread);
|
||||
} else if (file->type == PrepareAudio) {
|
||||
if (!h->peer->isChannel()) {
|
||||
flags |= MTPDmessage_flag_media_unread;
|
||||
flags |= MTPDmessage::flag_media_unread;
|
||||
}
|
||||
h->addNewMessage(MTP_message(MTP_int(flags), MTP_int(newId.msg), MTP_int(fromChannelName ? 0 : MTP::authedId()), peerToMTP(file->to.peer), MTPPeer(), MTPint(), MTP_int(file->to.replyTo), MTP_int(unixtime()), MTP_string(""), MTP_messageMediaAudio(file->audio), MTPnullMarkup, MTPnullEntities, MTP_int(1)), NewMessageUnread);
|
||||
}
|
||||
|
|
|
@ -235,7 +235,7 @@ void IntroCode::codeSubmitDone(const MTPauth_Authorization &result) {
|
|||
stopCheck();
|
||||
code.setDisabled(false);
|
||||
const MTPDauth_authorization &d(result.c_auth_authorization());
|
||||
if (d.vuser.type() != mtpc_user || !(d.vuser.c_user().vflags.v & MTPDuser_flag_self)) { // wtf?
|
||||
if (d.vuser.type() != mtpc_user || !d.vuser.c_user().is_self()) { // wtf?
|
||||
showError(lang(lng_server_error));
|
||||
return;
|
||||
}
|
||||
|
@ -309,7 +309,7 @@ void IntroCode::gotPassword(const MTPaccount_Password &result) {
|
|||
case mtpc_account_password: {
|
||||
const MTPDaccount_password &d(result.c_account_password());
|
||||
intro()->setPwdSalt(qba(d.vcurrent_salt));
|
||||
intro()->setHasRecovery(d.vhas_recovery.v);
|
||||
intro()->setHasRecovery(mtpIsTrue(d.vhas_recovery));
|
||||
intro()->setPwdHint(qs(d.vhint));
|
||||
intro()->onIntroNext();
|
||||
} break;
|
||||
|
|
|
@ -223,7 +223,7 @@ void IntroPhone::phoneCheckDone(const MTPauth_CheckedPhone &result) {
|
|||
stopCheck();
|
||||
|
||||
const MTPDauth_checkedPhone &d(result.c_auth_checkedPhone());
|
||||
if (d.vphone_registered.v) {
|
||||
if (mtpIsTrue(d.vphone_registered)) {
|
||||
disableAll();
|
||||
showError("");
|
||||
|
||||
|
@ -242,11 +242,11 @@ void IntroPhone::phoneSubmitDone(const MTPauth_SentCode &result) {
|
|||
|
||||
if (result.type() == mtpc_auth_sentCode) {
|
||||
const MTPDauth_sentCode &d(result.c_auth_sentCode());
|
||||
intro()->setPhone(sentPhone, d.vphone_code_hash.c_string().v.c_str(), d.vphone_registered.v);
|
||||
intro()->setPhone(sentPhone, d.vphone_code_hash.c_string().v.c_str(), mtpIsTrue(d.vphone_registered));
|
||||
intro()->setCallTimeout(d.vsend_call_timeout.v);
|
||||
} else if (result.type() == mtpc_auth_sentAppCode) {
|
||||
const MTPDauth_sentAppCode &d(result.c_auth_sentAppCode());
|
||||
intro()->setPhone(sentPhone, d.vphone_code_hash.c_string().v.c_str(), d.vphone_registered.v);
|
||||
intro()->setPhone(sentPhone, d.vphone_code_hash.c_string().v.c_str(), mtpIsTrue(d.vphone_registered));
|
||||
intro()->setCallTimeout(d.vsend_call_timeout.v);
|
||||
intro()->setCodeByTelegram(true);
|
||||
}
|
||||
|
|
|
@ -184,7 +184,7 @@ void IntroPwdCheck::pwdSubmitDone(bool recover, const MTPauth_Authorization &res
|
|||
_pwdField.setDisabled(false);
|
||||
_codeField.setDisabled(false);
|
||||
const MTPDauth_authorization &d(result.c_auth_authorization());
|
||||
if (d.vuser.type() != mtpc_user || !(d.vuser.c_user().vflags.v & MTPDuser_flag_self)) { // wtf?
|
||||
if (d.vuser.type() != mtpc_user || !d.vuser.c_user().is_self()) { // wtf?
|
||||
showError(lang(lng_server_error));
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -242,7 +242,7 @@ void IntroSignup::nameSubmitDone(const MTPauth_Authorization &result) {
|
|||
first.setDisabled(false);
|
||||
last.setDisabled(false);
|
||||
const MTPDauth_authorization &d(result.c_auth_authorization());
|
||||
if (d.vuser.type() != mtpc_user || !(d.vuser.c_user().vflags.v & MTPDuser_flag_self)) { // wtf?
|
||||
if (d.vuser.type() != mtpc_user || !d.vuser.c_user().is_self()) { // wtf?
|
||||
showError(lang(lng_server_error));
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1902,7 +1902,7 @@ namespace Local {
|
|||
|
||||
const BuiltInDc *bdcsipv6 = builtInDcsIPv6();
|
||||
for (int i = 0, l = builtInDcsCountIPv6(); i < l; ++i) {
|
||||
int32 flags = MTPDdcOption_flag_ipv6, idWithShift = bdcsipv6[i].id + (flags * _mtp_internal::dcShift);
|
||||
int32 flags = MTPDdcOption::flag_ipv6, idWithShift = bdcsipv6[i].id + (flags * _mtp_internal::dcShift);
|
||||
dcOpts.insert(idWithShift, mtpDcOption(bdcsipv6[i].id, flags, bdcsipv6[i].ip, bdcsipv6[i].port));
|
||||
DEBUG_LOG(("MTP Info: adding built in DC %1 IPv6 connect option: %2:%3").arg(bdcsipv6[i].id).arg(bdcsipv6[i].ip).arg(bdcsipv6[i].port));
|
||||
}
|
||||
|
@ -1946,7 +1946,7 @@ namespace Local {
|
|||
|
||||
const BuiltInDc *bdcsipv6 = builtInDcsIPv6();
|
||||
for (int i = 0, l = builtInDcsCountIPv6(); i < l; ++i) {
|
||||
dcOpts.insert(bdcsipv6[i].id + (MTPDdcOption_flag_ipv6 * _mtp_internal::dcShift), mtpDcOption(bdcsipv6[i].id, MTPDdcOption_flag_ipv6, bdcsipv6[i].ip, bdcsipv6[i].port));
|
||||
dcOpts.insert(bdcsipv6[i].id + (MTPDdcOption::flag_ipv6 * _mtp_internal::dcShift), mtpDcOption(bdcsipv6[i].id, MTPDdcOption::flag_ipv6, bdcsipv6[i].ip, bdcsipv6[i].port));
|
||||
DEBUG_LOG(("MTP Info: adding built in DC %1 IPv6 connect option: %2:%3").arg(bdcsipv6[i].id).arg(bdcsipv6[i].ip).arg(bdcsipv6[i].port));
|
||||
}
|
||||
|
||||
|
@ -2571,7 +2571,7 @@ namespace Local {
|
|||
for (StickerSets::const_iterator i = sets.cbegin(); i != sets.cend(); ++i) {
|
||||
bool notLoaded = (i->flags & MTPDstickerSet_flag_NOT_LOADED);
|
||||
if (notLoaded) {
|
||||
if (!(i->flags & MTPDstickerSet_flag_disabled)) { // waiting to receive
|
||||
if (!(i->flags & MTPDstickerSet::flag_disabled)) { // waiting to receive
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
|
@ -2630,7 +2630,7 @@ namespace Local {
|
|||
|
||||
cSetStickersHash(QByteArray());
|
||||
|
||||
StickerSet &def(sets.insert(DefaultStickerSetId, StickerSet(DefaultStickerSetId, 0, lang(lng_stickers_default_set), QString(), 0, 0, MTPDstickerSet_flag_official)).value());
|
||||
StickerSet &def(sets.insert(DefaultStickerSetId, StickerSet(DefaultStickerSetId, 0, lang(lng_stickers_default_set), QString(), 0, 0, MTPDstickerSet::flag_official)).value());
|
||||
StickerSet &custom(sets.insert(CustomStickerSetId, StickerSet(CustomStickerSetId, 0, lang(lng_custom_stickers), QString(), 0, 0, 0)).value());
|
||||
|
||||
QMap<uint64, bool> read;
|
||||
|
@ -2723,7 +2723,7 @@ namespace Local {
|
|||
|
||||
if (setId == DefaultStickerSetId) {
|
||||
setTitle = lang(lng_stickers_default_set);
|
||||
setFlags |= MTPDstickerSet_flag_official;
|
||||
setFlags |= MTPDstickerSet::flag_official;
|
||||
order.push_front(setId);
|
||||
} else if (setId == CustomStickerSetId) {
|
||||
setTitle = lang(lng_custom_stickers);
|
||||
|
|
|
@ -621,7 +621,7 @@ void MainWidget::finishForwarding(History *hist, bool broadcast) {
|
|||
ids.push_back(MTP_int(i.key()));
|
||||
randomIds.push_back(MTP_long(randomId));
|
||||
}
|
||||
int32 flags = fromChannelName ? MTPmessages_ForwardMessages_flag_broadcast : 0;
|
||||
int32 flags = fromChannelName ? MTPmessages_ForwardMessages::flag_broadcast : 0;
|
||||
hist->sendRequestId = MTP::send(MTPmessages_ForwardMessages(MTP_int(flags), forwardFrom->input, MTP_vector<MTPint>(ids), MTP_vector<MTPlong>(randomIds), hist->peer->input), rpcDone(&MainWidget::sentUpdatesReceived), RPCFailHandlerPtr(), 0, 0, hist->sendRequestId);
|
||||
|
||||
if (history.peer() == hist->peer) history.peerMessagesUpdated();
|
||||
|
@ -1173,7 +1173,7 @@ void MainWidget::sendMessage(History *hist, const QString &text, MsgId replyTo,
|
|||
}
|
||||
MTPMessageMedia media = MTP_messageMediaEmpty();
|
||||
if (webPageId == 0xFFFFFFFFFFFFFFFFULL) {
|
||||
sendFlags |= MTPmessages_SendMessage_flag_skipWebPage;
|
||||
sendFlags |= MTPmessages_SendMessage::flag_no_webpage;
|
||||
} else if (webPageId) {
|
||||
WebPageData *page = App::webPage(webPageId);
|
||||
media = MTP_messageMediaWebPage(MTP_webPagePending(MTP_long(page->id), MTP_int(page->pendingTill)));
|
||||
|
@ -1292,7 +1292,7 @@ void MainWidget::preloadOverviews(PeerData *peer) {
|
|||
MTPMessagesFilter filter = typeToMediaFilter(type);
|
||||
if (type == OverviewCount) break;
|
||||
|
||||
int32 flags = peer->isChannel() ? MTPmessages_Search_flag_only_important : 0;
|
||||
int32 flags = peer->isChannel() ? MTPmessages_Search::flag_important_only : 0;
|
||||
_overviewPreload[i].insert(peer, MTP::send(MTPmessages_Search(MTP_int(flags), peer->input, MTP_string(""), filter, MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(0)), rpcDone(&MainWidget::overviewPreloaded, peer), rpcFail(&MainWidget::overviewFailed, peer), 0, (i == last) ? 0 : 10));
|
||||
}
|
||||
}
|
||||
|
@ -1479,7 +1479,7 @@ void MainWidget::loadMediaBack(PeerData *peer, MediaOverviewType type, bool many
|
|||
MTPMessagesFilter filter = typeToMediaFilter(type);
|
||||
if (type == OverviewCount) return;
|
||||
|
||||
int32 flags = peer->isChannel() ? MTPmessages_Search_flag_only_important : 0;
|
||||
int32 flags = peer->isChannel() ? MTPmessages_Search::flag_important_only : 0;
|
||||
_overviewLoad[type].insert(peer, MTP::send(MTPmessages_Search(MTP_int(flags), peer->input, MTPstring(), filter, MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(minId), MTP_int(limit)), rpcDone(&MainWidget::overviewLoaded, hist)));
|
||||
}
|
||||
|
||||
|
@ -2011,7 +2011,7 @@ void MainWidget::dialogsCancelled() {
|
|||
}
|
||||
|
||||
void MainWidget::serviceNotification(const QString &msg, const MTPMessageMedia &media) {
|
||||
int32 flags = MTPDmessage_flag_unread | MTPDmessage::flag_entities | MTPDmessage::flag_from_id;
|
||||
int32 flags = MTPDmessage::flag_unread | MTPDmessage::flag_entities | MTPDmessage::flag_from_id;
|
||||
QString sendingText, leftText = msg;
|
||||
EntitiesInText sendingEntities, leftEntities = textParseEntities(leftText, _historyTextNoMonoOptions.flags);
|
||||
HistoryItem *item = 0;
|
||||
|
@ -3013,12 +3013,13 @@ void MainWidget::updSetState(int32 pts, int32 date, int32 qts, int32 seq) {
|
|||
void MainWidget::gotChannelDifference(ChannelData *channel, const MTPupdates_ChannelDifference &diff) {
|
||||
_channelFailDifferenceTimeout.remove(channel);
|
||||
|
||||
int32 timeout = 0, flags = 0;
|
||||
int32 timeout = 0;
|
||||
bool isFinal = true;
|
||||
switch (diff.type()) {
|
||||
case mtpc_updates_channelDifferenceEmpty: {
|
||||
const MTPDupdates_channelDifferenceEmpty &d(diff.c_updates_channelDifferenceEmpty());
|
||||
if (d.has_timeout()) timeout = d.vtimeout.v;
|
||||
flags = d.vflags.v;
|
||||
isFinal = d.is_final();
|
||||
channel->ptsInit(d.vpts.v);
|
||||
} break;
|
||||
|
||||
|
@ -3053,7 +3054,7 @@ void MainWidget::gotChannelDifference(ChannelData *channel, const MTPupdates_Cha
|
|||
}
|
||||
|
||||
if (d.has_timeout()) timeout = d.vtimeout.v;
|
||||
flags = d.vflags.v;
|
||||
isFinal = d.is_final();
|
||||
channel->ptsInit(d.vpts.v);
|
||||
} break;
|
||||
|
||||
|
@ -3117,14 +3118,14 @@ void MainWidget::gotChannelDifference(ChannelData *channel, const MTPupdates_Cha
|
|||
_handlingChannelDifference = false;
|
||||
|
||||
if (d.has_timeout()) timeout = d.vtimeout.v;
|
||||
flags = d.vflags.v;
|
||||
isFinal = d.is_final();
|
||||
channel->ptsInit(d.vpts.v);
|
||||
} break;
|
||||
}
|
||||
|
||||
channel->ptsSetRequesting(false);
|
||||
|
||||
if (!(flags & MTPupdates_ChannelDifference_flag_final)) {
|
||||
if (!isFinal) {
|
||||
MTP_LOG(0, ("getChannelDifference { good - after not final channelDifference was received }%1").arg(cTestMode() ? " TESTMODE" : ""));
|
||||
getChannelDifference(channel);
|
||||
} else if (activePeer() == channel) {
|
||||
|
@ -3135,12 +3136,13 @@ void MainWidget::gotChannelDifference(ChannelData *channel, const MTPupdates_Cha
|
|||
}
|
||||
|
||||
void MainWidget::gotRangeDifference(ChannelData *channel, const MTPupdates_ChannelDifference &diff) {
|
||||
int32 flags = 0, nextRequestPts = 0;
|
||||
int32 nextRequestPts = 0;
|
||||
bool isFinal = true;
|
||||
switch (diff.type()) {
|
||||
case mtpc_updates_channelDifferenceEmpty: {
|
||||
const MTPDupdates_channelDifferenceEmpty &d(diff.c_updates_channelDifferenceEmpty());
|
||||
flags = d.vflags.v;
|
||||
nextRequestPts = d.vpts.v;
|
||||
isFinal = d.is_final();
|
||||
} break;
|
||||
|
||||
case mtpc_updates_channelDifferenceTooLong: {
|
||||
|
@ -3149,8 +3151,8 @@ void MainWidget::gotRangeDifference(ChannelData *channel, const MTPupdates_Chann
|
|||
App::feedUsers(d.vusers);
|
||||
App::feedChats(d.vchats);
|
||||
|
||||
flags = d.vflags.v;
|
||||
nextRequestPts = d.vpts.v;
|
||||
isFinal = d.is_final();
|
||||
} break;
|
||||
|
||||
case mtpc_updates_channelDifference: {
|
||||
|
@ -3165,12 +3167,12 @@ void MainWidget::gotRangeDifference(ChannelData *channel, const MTPupdates_Chann
|
|||
feedUpdateVector(d.vother_updates, true);
|
||||
_handlingChannelDifference = false;
|
||||
|
||||
flags = d.vflags.v;
|
||||
nextRequestPts = d.vpts.v;
|
||||
isFinal = d.is_final();
|
||||
} break;
|
||||
}
|
||||
|
||||
if (!(flags & MTPupdates_ChannelDifference_flag_final)) {
|
||||
if (!isFinal) {
|
||||
if (History *h = App::historyLoaded(channel->id)) {
|
||||
MTP_LOG(0, ("getChannelDifference { good - after not final channelDifference was received, validating history part }%1").arg(cTestMode() ? " TESTMODE" : ""));
|
||||
h->asChannelHistory()->getRangeDifferenceNext(nextRequestPts);
|
||||
|
@ -3641,8 +3643,7 @@ void MainWidget::inviteCheckDone(QString hash, const MTPChatInvite &invite) {
|
|||
switch (invite.type()) {
|
||||
case mtpc_chatInvite: {
|
||||
const MTPDchatInvite &d(invite.c_chatInvite());
|
||||
bool isChannel = (d.vflags.v & MTPDchatInvite_flag_is_channel);
|
||||
ConfirmBox *box = new ConfirmBox((isChannel ? lng_group_invite_want_join_channel : lng_group_invite_want_join)(lt_title, qs(d.vtitle)), lang(lng_group_invite_join));
|
||||
ConfirmBox *box = new ConfirmBox((d.is_channel() ? lng_group_invite_want_join_channel : lng_group_invite_want_join)(lt_title, qs(d.vtitle)), lang(lng_group_invite_join));
|
||||
_inviteHash = hash;
|
||||
connect(box, SIGNAL(confirmed()), this, SLOT(onInviteImport()));
|
||||
App::wnd()->showLayer(box);
|
||||
|
@ -3714,7 +3715,7 @@ bool MainWidget::inviteImportFail(const RPCError &error) {
|
|||
|
||||
void MainWidget::startFull(const MTPVector<MTPUser> &users) {
|
||||
const QVector<MTPUser> &v(users.c_vector().v);
|
||||
if (v.isEmpty() || v[0].type() != mtpc_user || !(v[0].c_user().vflags.v & MTPDuser_flag_self)) { // wtf?..
|
||||
if (v.isEmpty() || v[0].type() != mtpc_user || !v[0].c_user().is_self()) { // wtf?..
|
||||
return App::logOut();
|
||||
}
|
||||
start(v[0]);
|
||||
|
@ -3766,7 +3767,7 @@ void MainWidget::applyNotifySetting(const MTPNotifyPeer &peer, const MTPPeerNoti
|
|||
|
||||
setTo->mute = d.vmute_until.v;
|
||||
setTo->sound = d.vsound.c_string().v;
|
||||
setTo->previews = d.vshow_previews.v;
|
||||
setTo->previews = mtpIsTrue(d.vshow_previews);
|
||||
setTo->events = d.vevents_mask.v;
|
||||
if (data) {
|
||||
if (!h) h = App::history(data->id);
|
||||
|
@ -4114,8 +4115,7 @@ void MainWidget::feedUpdates(const MTPUpdates &updates, uint64 randomId) {
|
|||
|
||||
// update before applying skipped
|
||||
int32 flags = d.vflags.v | MTPDmessage::flag_from_id;
|
||||
bool out = (flags & MTPDmessage_flag_out);
|
||||
HistoryItem *item = App::histories().addNewMessage(MTP_message(MTP_int(flags), d.vid, out ? MTP_int(MTP::authedId()) : d.vuser_id, MTP_peerUser(out ? d.vuser_id : MTP_int(MTP::authedId())), d.vfwd_from_id, d.vfwd_date, d.vreply_to_msg_id, d.vdate, d.vmessage, MTP_messageMediaEmpty(), MTPnullMarkup, d.has_entities() ? d.ventities : MTPnullEntities, MTPint()), NewMessageUnread);
|
||||
HistoryItem *item = App::histories().addNewMessage(MTP_message(MTP_int(flags), d.vid, d.is_out() ? MTP_int(MTP::authedId()) : d.vuser_id, MTP_peerUser(d.is_out() ? d.vuser_id : MTP_int(MTP::authedId())), d.vfwd_from_id, d.vfwd_date, d.vreply_to_msg_id, d.vdate, d.vmessage, MTP_messageMediaEmpty(), MTPnullMarkup, d.has_entities() ? d.ventities : MTPnullEntities, MTPint()), NewMessageUnread);
|
||||
if (item) {
|
||||
history.peerMessagesUpdated(item->history()->peer->id);
|
||||
}
|
||||
|
@ -4140,7 +4140,6 @@ void MainWidget::feedUpdates(const MTPUpdates &updates, uint64 randomId) {
|
|||
|
||||
// update before applying skipped
|
||||
int32 flags = d.vflags.v | MTPDmessage::flag_from_id;
|
||||
bool out = (flags & MTPDmessage_flag_out);
|
||||
HistoryItem *item = App::histories().addNewMessage(MTP_message(MTP_int(flags), d.vid, d.vfrom_id, MTP_peerChat(d.vchat_id), d.vfwd_from_id, d.vfwd_date, d.vreply_to_msg_id, d.vdate, d.vmessage, MTP_messageMediaEmpty(), MTPnullMarkup, d.has_entities() ? d.ventities : MTPnullEntities, MTPint()), NewMessageUnread);
|
||||
if (item) {
|
||||
history.peerMessagesUpdated(item->history()->peer->id);
|
||||
|
@ -4444,7 +4443,7 @@ void MainWidget::feedUpdate(const MTPUpdate &update) {
|
|||
if (user) {
|
||||
user->setPhoto(d.vphoto);
|
||||
user->photo->load();
|
||||
if (d.vprevious.v) {
|
||||
if (mtpIsTrue(d.vprevious)) {
|
||||
user->photosCount = -1;
|
||||
user->photos.clear();
|
||||
} else {
|
||||
|
@ -4466,7 +4465,7 @@ void MainWidget::feedUpdate(const MTPUpdate &update) {
|
|||
UserData *user = App::userLoaded(d.vuser_id.v);
|
||||
if (user) {
|
||||
if (App::history(user->id)->loadedAtBottom()) {
|
||||
App::history(user->id)->addNewService(clientMsgId(), date(d.vdate), lng_action_user_registered(lt_from, user->name), MTPDmessage_flag_unread);
|
||||
App::history(user->id)->addNewService(clientMsgId(), date(d.vdate), lng_action_user_registered(lt_from, user->name), MTPDmessage::flag_unread);
|
||||
}
|
||||
}
|
||||
} break;
|
||||
|
@ -4515,7 +4514,7 @@ void MainWidget::feedUpdate(const MTPUpdate &update) {
|
|||
case mtpc_updateUserBlocked: {
|
||||
const MTPDupdateUserBlocked &d(update.c_updateUserBlocked());
|
||||
if (UserData *user = App::userLoaded(d.vuser_id.v)) {
|
||||
user->blocked = d.vblocked.v ? UserIsBlocked : UserIsNotBlocked;
|
||||
user->blocked = mtpIsTrue(d.vblocked) ? UserIsBlocked : UserIsNotBlocked;
|
||||
App::markPeerUpdated(user);
|
||||
}
|
||||
} break;
|
||||
|
@ -4535,7 +4534,7 @@ void MainWidget::feedUpdate(const MTPUpdate &update) {
|
|||
|
||||
case mtpc_updateServiceNotification: {
|
||||
const MTPDupdateServiceNotification &d(update.c_updateServiceNotification());
|
||||
if (d.vpopup.v) {
|
||||
if (mtpIsTrue(d.vpopup)) {
|
||||
App::wnd()->showLayer(new InformBox(qs(d.vmessage)));
|
||||
App::wnd()->serviceNotification(qs(d.vmessage), d.vmedia);
|
||||
} else {
|
||||
|
|
|
@ -80,7 +80,8 @@ with open('scheme.tl') as f:
|
|||
|
||||
nametype = re.match(r'([a-zA-Z\.0-9_]+)#([0-9a-f]+)([^=]*)=\s*([a-zA-Z\.<>0-9_]+);', line);
|
||||
if (not nametype):
|
||||
print('Bad line found: ' + line);
|
||||
if (not re.match(r'vector#1cb5c415 \{t:Type\} # \[ t \] = Vector t;', line)):
|
||||
print('Bad line found: ' + line);
|
||||
continue;
|
||||
|
||||
name = nametype.group(1);
|
||||
|
@ -123,6 +124,7 @@ with open('scheme.tl') as f:
|
|||
paramsList = params.strip().split(' ');
|
||||
prms = {};
|
||||
conditions = {};
|
||||
trivialConditions = {}; # true type
|
||||
prmsList = [];
|
||||
conditionsList = [];
|
||||
isTemplate = hasFlags = hasTemplate = '';
|
||||
|
@ -167,6 +169,8 @@ with open('scheme.tl') as f:
|
|||
if (not pname in conditions):
|
||||
conditionsList.append(pname);
|
||||
conditions[pname] = pmasktype.group(2);
|
||||
if (ptype == 'true'):
|
||||
trivialConditions[pname] = 1;
|
||||
elif (ptype.find('<') >= 0):
|
||||
templ = re.match(r'^([vV]ector<)([A-Za-z0-9\._]+)>$', ptype);
|
||||
if (templ):
|
||||
|
@ -191,8 +195,10 @@ with open('scheme.tl') as f:
|
|||
prmsStr = [];
|
||||
prmsInit = [];
|
||||
prmsNames = [];
|
||||
if (len(prms)):
|
||||
if (len(prms) > len(trivialConditions)):
|
||||
for paramName in prmsList:
|
||||
if (paramName in trivialConditions):
|
||||
continue;
|
||||
paramType = prms[paramName];
|
||||
prmsInit.append('v' + paramName + '(_' + paramName + ')');
|
||||
prmsNames.append('_' + paramName);
|
||||
|
@ -209,7 +215,7 @@ with open('scheme.tl') as f:
|
|||
|
||||
funcsText += '\tMTP' + name + '() {\n\t}\n'; # constructor
|
||||
funcsText += '\tMTP' + name + '(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_' + name + ') {\n\t\tread(from, end, cons);\n\t}\n'; # stream constructor
|
||||
if (len(prms)):
|
||||
if (len(prms) > len(trivialConditions)):
|
||||
funcsText += '\tMTP' + name + '(' + ', '.join(prmsStr) + ') : ' + ', '.join(prmsInit) + ' {\n\t}\n';
|
||||
|
||||
if (len(conditions)):
|
||||
|
@ -220,7 +226,10 @@ with open('scheme.tl') as f:
|
|||
funcsText += '\t};\n';
|
||||
funcsText += '\n';
|
||||
for paramName in conditionsList:
|
||||
funcsText += '\tbool has_' + paramName + '() const { return v' + hasFlags + '.v & flag_' + paramName + '; }\n';
|
||||
if (paramName in trivialConditions):
|
||||
funcsText += '\tbool is_' + paramName + '() const { return v' + hasFlags + '.v & flag_' + paramName + '; }\n';
|
||||
else:
|
||||
funcsText += '\tbool has_' + paramName + '() const { return v' + hasFlags + '.v & flag_' + paramName + '; }\n';
|
||||
|
||||
funcsText += '\n';
|
||||
funcsText += '\tuint32 innerLength() const {\n'; # count size
|
||||
|
@ -228,7 +237,8 @@ with open('scheme.tl') as f:
|
|||
for k in prmsList:
|
||||
v = prms[k];
|
||||
if (k in conditionsList):
|
||||
size.append('(has_' + k + '() ? v' + k + '.innerLength() : 0)');
|
||||
if (not k in trivialConditions):
|
||||
size.append('(has_' + k + '() ? v' + k + '.innerLength() : 0)');
|
||||
else:
|
||||
size.append('v' + k + '.innerLength()');
|
||||
if (not len(size)):
|
||||
|
@ -242,7 +252,8 @@ with open('scheme.tl') as f:
|
|||
for k in prmsList:
|
||||
v = prms[k];
|
||||
if (k in conditionsList):
|
||||
funcsText += '\t\tif (has_' + k + '()) { v' + k + '.read(from, end); } else { v' + k + ' = MTP' + v + '(); }\n';
|
||||
if (not k in trivialConditions):
|
||||
funcsText += '\t\tif (has_' + k + '()) { v' + k + '.read(from, end); } else { v' + k + ' = MTP' + v + '(); }\n';
|
||||
else:
|
||||
funcsText += '\t\tv' + k + '.read(from, end);\n';
|
||||
funcsText += '\t}\n';
|
||||
|
@ -251,7 +262,8 @@ with open('scheme.tl') as f:
|
|||
for k in prmsList:
|
||||
v = prms[k];
|
||||
if (k in conditionsList):
|
||||
funcsText += '\t\tif (has_' + k + '()) v' + k + '.write(to);\n';
|
||||
if (not k in trivialConditions):
|
||||
funcsText += '\t\tif (has_' + k + '()) v' + k + '.write(to);\n';
|
||||
else:
|
||||
funcsText += '\t\tv' + k + '.write(to);\n';
|
||||
funcsText += '\t}\n';
|
||||
|
@ -268,7 +280,7 @@ with open('scheme.tl') as f:
|
|||
funcsText += 'public:\n';
|
||||
funcsText += '\tMTP' + Name + '() {\n\t}\n';
|
||||
funcsText += '\tMTP' + Name + '(const MTP' + name + '<TQueryType> &v) : MTPBoxed<MTP' + name + '<TQueryType> >(v) {\n\t}\n';
|
||||
if (len(prms)):
|
||||
if (len(prms) > len(trivialConditions)):
|
||||
funcsText += '\tMTP' + Name + '(' + ', '.join(prmsStr) + ') : MTPBoxed<MTP' + name + '<TQueryType> >(MTP' + name + '<TQueryType>(' + ', '.join(prmsNames) + ')) {\n\t}\n';
|
||||
funcsText += '};\n';
|
||||
else:
|
||||
|
@ -277,7 +289,7 @@ with open('scheme.tl') as f:
|
|||
funcsText += '\tMTP' + Name + '() {\n\t}\n';
|
||||
funcsText += '\tMTP' + Name + '(const MTP' + name + ' &v) : MTPBoxed<MTP' + name + '>(v) {\n\t}\n';
|
||||
funcsText += '\tMTP' + Name + '(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed<MTP' + name + '>(from, end, cons) {\n\t}\n';
|
||||
if (len(prms)):
|
||||
if (len(prms) > len(trivialConditions)):
|
||||
funcsText += '\tMTP' + Name + '(' + ', '.join(prmsStr) + ') : MTPBoxed<MTP' + name + '>(MTP' + name + '(' + ', '.join(prmsNames) + ')) {\n\t}\n';
|
||||
funcsText += '};\n';
|
||||
funcs = funcs + 1;
|
||||
|
@ -286,7 +298,7 @@ with open('scheme.tl') as f:
|
|||
funcsList.append(restype);
|
||||
funcsDict[restype] = [];
|
||||
# TypesDict[restype] = resType;
|
||||
funcsDict[restype].append([name, typeid, prmsList, prms, hasFlags, conditionsList, conditions]);
|
||||
funcsDict[restype].append([name, typeid, prmsList, prms, hasFlags, conditionsList, conditions, trivialConditions]);
|
||||
else:
|
||||
if (isTemplate != ''):
|
||||
print('Template types not allowed: "' + resType + '" in line: ' + line);
|
||||
|
@ -295,7 +307,7 @@ with open('scheme.tl') as f:
|
|||
typesList.append(restype);
|
||||
typesDict[restype] = [];
|
||||
TypesDict[restype] = resType;
|
||||
typesDict[restype].append([name, typeid, prmsList, prms, hasFlags, conditionsList, conditions]);
|
||||
typesDict[restype].append([name, typeid, prmsList, prms, hasFlags, conditionsList, conditions, trivialConditions]);
|
||||
|
||||
consts = consts + 1;
|
||||
|
||||
|
@ -311,6 +323,7 @@ def addTextSerialize(lst, dct, dataLetter):
|
|||
hasFlags = data[4];
|
||||
conditionsList = data[5];
|
||||
conditions = data[6];
|
||||
trivialConditions = data[7];
|
||||
|
||||
result += 'void _serialize_' + name + '(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) {\n';
|
||||
if (len(prms)):
|
||||
|
@ -327,52 +340,57 @@ def addTextSerialize(lst, dct, dataLetter):
|
|||
result += '\tcase ' + str(stage) + ': to.add(" ' + k + ': "); ++stages.back(); ';
|
||||
if (k == hasFlags):
|
||||
result += 'if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; ';
|
||||
if (k in conditionsList):
|
||||
if (k in trivialConditions):
|
||||
result += 'if (flag & MTP' + dataLetter + name + '::flag_' + k + ') { ';
|
||||
result += 'types.push_back(';
|
||||
vtypeget = re.match(r'^[Vv]ector<MTP([A-Za-z0-9\._]+)>', v);
|
||||
if (vtypeget):
|
||||
if (not re.match(r'^[A-Z]', v)):
|
||||
result += 'mtpc_vector';
|
||||
else:
|
||||
result += '0';
|
||||
restype = vtypeget.group(1);
|
||||
try:
|
||||
if boxed[restype]:
|
||||
restype = 0;
|
||||
except KeyError:
|
||||
if re.match(r'^[A-Z]', restype):
|
||||
restype = 0;
|
||||
else:
|
||||
restype = v;
|
||||
try:
|
||||
if boxed[restype]:
|
||||
restype = 0;
|
||||
except KeyError:
|
||||
if re.match(r'^[A-Z]', restype):
|
||||
restype = 0;
|
||||
if (restype):
|
||||
try:
|
||||
conses = typesDict[restype];
|
||||
if (len(conses) > 1):
|
||||
print('Complex bare type found: "' + restype + '" trying to serialize "' + k + '" of type "' + v + '"');
|
||||
continue;
|
||||
if (vtypeget):
|
||||
result += '); vtypes.push_back(';
|
||||
result += 'mtpc_' + conses[0][0];
|
||||
if (not vtypeget):
|
||||
result += '); vtypes.push_back(0';
|
||||
except KeyError:
|
||||
if (vtypeget):
|
||||
result += '); vtypes.push_back(';
|
||||
result += 'mtpc_' + restype;
|
||||
if (not vtypeget):
|
||||
result += '); vtypes.push_back(0';
|
||||
else:
|
||||
result += '0); vtypes.push_back(0';
|
||||
result += '); stages.push_back(0); flags.push_back(0); ';
|
||||
if (k in conditionsList):
|
||||
result += 'to.add("NO [ BY BIT ' + conditions[k] + ' IN FIELD ' + hasFlags + ' ]"); ';
|
||||
result += '} else { to.add("[ SKIPPED BY BIT ' + conditions[k] + ' IN FIELD ' + hasFlags + ' ]"); } ';
|
||||
else:
|
||||
if (k in conditions):
|
||||
result += 'if (flag & MTP' + dataLetter + name + '::flag_' + k + ') { ';
|
||||
result += 'types.push_back(';
|
||||
vtypeget = re.match(r'^[Vv]ector<MTP([A-Za-z0-9\._]+)>', v);
|
||||
if (vtypeget):
|
||||
if (not re.match(r'^[A-Z]', v)):
|
||||
result += 'mtpc_vector';
|
||||
else:
|
||||
result += '0';
|
||||
restype = vtypeget.group(1);
|
||||
try:
|
||||
if boxed[restype]:
|
||||
restype = 0;
|
||||
except KeyError:
|
||||
if re.match(r'^[A-Z]', restype):
|
||||
restype = 0;
|
||||
else:
|
||||
restype = v;
|
||||
try:
|
||||
if boxed[restype]:
|
||||
restype = 0;
|
||||
except KeyError:
|
||||
if re.match(r'^[A-Z]', restype):
|
||||
restype = 0;
|
||||
if (restype):
|
||||
try:
|
||||
conses = typesDict[restype];
|
||||
if (len(conses) > 1):
|
||||
print('Complex bare type found: "' + restype + '" trying to serialize "' + k + '" of type "' + v + '"');
|
||||
continue;
|
||||
if (vtypeget):
|
||||
result += '); vtypes.push_back(';
|
||||
result += 'mtpc_' + conses[0][0];
|
||||
if (not vtypeget):
|
||||
result += '); vtypes.push_back(0';
|
||||
except KeyError:
|
||||
if (vtypeget):
|
||||
result += '); vtypes.push_back(';
|
||||
result += 'mtpc_' + restype;
|
||||
if (not vtypeget):
|
||||
result += '); vtypes.push_back(0';
|
||||
else:
|
||||
result += '0); vtypes.push_back(0';
|
||||
result += '); stages.push_back(0); flags.push_back(0); ';
|
||||
if (k in conditions):
|
||||
result += '} else { to.add("[ SKIPPED BY BIT ' + conditions[k] + ' IN FIELD ' + hasFlags + ' ]"); } ';
|
||||
result += 'break;\n';
|
||||
stage = stage + 1;
|
||||
result += '\tdefault: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break;\n';
|
||||
|
@ -426,6 +444,7 @@ for restype in typesList:
|
|||
hasFlags = data[4];
|
||||
conditionsList = data[5];
|
||||
conditions = data[6];
|
||||
trivialConditions = data[7];
|
||||
|
||||
dataText = '';
|
||||
dataText += '\nclass MTPD' + name + ' : public mtpDataImpl<MTPD' + name + '> {\n'; # data class
|
||||
|
@ -438,7 +457,7 @@ for restype in typesList:
|
|||
writeText = '';
|
||||
dataText += '\tMTPD' + name + '() {\n\t}\n'; # default constructor
|
||||
switchLines += '\t\tcase mtpc_' + name + ': '; # for by-type-id type constructor
|
||||
if (len(prms)):
|
||||
if (len(prms) > len(trivialConditions)):
|
||||
switchLines += 'setData(new MTPD' + name + '()); ';
|
||||
withData = 1;
|
||||
|
||||
|
@ -467,6 +486,8 @@ for restype in typesList:
|
|||
prmsStr = [];
|
||||
prmsInit = [];
|
||||
for paramName in prmsList:
|
||||
if (paramName in trivialConditions):
|
||||
continue;
|
||||
paramType = prms[paramName];
|
||||
|
||||
if (paramType in ['int', 'Int', 'bool', 'Bool']):
|
||||
|
@ -480,7 +501,7 @@ for restype in typesList:
|
|||
if (withType):
|
||||
readText += '\t\t';
|
||||
writeText += '\t\t';
|
||||
if (paramName in conditionsList):
|
||||
if (paramName in conditions):
|
||||
readText += '\tif (v.has_' + paramName + '()) { v.v' + paramName + '.read(from, end); } else { v.v' + paramName + ' = MTP' + paramType + '(); }\n';
|
||||
writeText += '\tif (v.has_' + paramName + '()) v.v' + paramName + '.write(to);\n';
|
||||
sizeList.append('(v.has_' + paramName + '() ? v.v' + paramName + '.innerLength() : 0)');
|
||||
|
@ -495,6 +516,8 @@ for restype in typesList:
|
|||
|
||||
dataText += '\n';
|
||||
for paramName in prmsList: # fields declaration
|
||||
if (paramName in trivialConditions):
|
||||
continue;
|
||||
paramType = prms[paramName];
|
||||
dataText += '\tMTP' + paramType + ' v' + paramName + ';\n';
|
||||
sizeCases += '\t\tcase mtpc_' + name + ': {\n';
|
||||
|
@ -516,15 +539,18 @@ for restype in typesList:
|
|||
dataText += '\t};\n';
|
||||
dataText += '\n';
|
||||
for paramName in conditionsList:
|
||||
dataText += '\tbool has_' + paramName + '() const { return v' + hasFlags + '.v & flag_' + paramName + '; }\n';
|
||||
if (paramName in trivialConditions):
|
||||
dataText += '\tbool is_' + paramName + '() const { return v' + hasFlags + '.v & flag_' + paramName + '; }\n';
|
||||
else:
|
||||
dataText += '\tbool has_' + paramName + '() const { return v' + hasFlags + '.v & flag_' + paramName + '; }\n';
|
||||
dataText += '};\n'; # class ending
|
||||
|
||||
if (len(prms)):
|
||||
if (len(prms) > len(trivialConditions)):
|
||||
dataTexts += dataText; # add data class
|
||||
|
||||
friendDecl += '\tfriend MTP' + restype + ' MTP_' + name + '(' + ', '.join(creatorParams) + ');\n';
|
||||
creatorsText += 'inline MTP' + restype + ' MTP_' + name + '(' + ', '.join(creatorParams) + ') {\n';
|
||||
if (len(prms)): # creator with params
|
||||
if (len(prms) > len(trivialConditions)): # creator with params
|
||||
creatorsText += '\treturn MTP' + restype + '(new MTPD' + name + '(' + ', '.join(creatorParamsList) + '));\n';
|
||||
else:
|
||||
if (withType): # creator by type
|
||||
|
@ -535,7 +561,7 @@ for restype in typesList:
|
|||
|
||||
if (withType):
|
||||
reader += '\t\tcase mtpc_' + name + ': _type = cons; '; # read switch line
|
||||
if (len(prms)):
|
||||
if (len(prms) > len(trivialConditions)):
|
||||
reader += '{\n';
|
||||
reader += '\t\t\tif (!data) setData(new MTPD' + name + '());\n';
|
||||
reader += '\t\t\tMTPD' + name + ' &v(_' + name + '());\n';
|
||||
|
@ -549,7 +575,7 @@ for restype in typesList:
|
|||
else:
|
||||
reader += 'break;\n';
|
||||
else:
|
||||
if (len(prms)):
|
||||
if (len(prms) > len(trivialConditions)):
|
||||
reader += '\n\tif (!data) setData(new MTPD' + name + '());\n';
|
||||
reader += '\tMTPD' + name + ' &v(_' + name + '());\n';
|
||||
reader += readText;
|
||||
|
|
|
@ -632,7 +632,7 @@ tcpNonce(MTP::nonce<MTPint128>()), httpNonce(MTP::nonce<MTPint128>()), _tcpTimeo
|
|||
|
||||
void MTPautoConnection::onHttpStart() {
|
||||
if (status == HttpReady) {
|
||||
DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by timer").arg((_flags & MTPDdcOption_flag_ipv6) ? "IPv6" : "IPv4"));
|
||||
DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by timer").arg((_flags & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4"));
|
||||
status = UsingHttp;
|
||||
sock.disconnectFromHost();
|
||||
emit connected();
|
||||
|
@ -643,7 +643,7 @@ void MTPautoConnection::onSocketConnected() {
|
|||
if (status == HttpReady || status == WaitingBoth || status == WaitingTcp) {
|
||||
mtpBuffer buffer(_preparePQFake(tcpNonce));
|
||||
|
||||
DEBUG_LOG(("Connection Info: sending fake req_pq through TCP/%1 transport").arg((_flags & MTPDdcOption_flag_ipv6) ? "IPv6" : "IPv4"));
|
||||
DEBUG_LOG(("Connection Info: sending fake req_pq through TCP/%1 transport").arg((_flags & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4"));
|
||||
|
||||
if (_tcpTimeout < 0) _tcpTimeout = -_tcpTimeout;
|
||||
tcpTimeoutTimer.start(_tcpTimeout);
|
||||
|
@ -681,7 +681,7 @@ void MTPautoConnection::onSocketDisconnected() {
|
|||
} else if (status == WaitingTcp || status == UsingTcp) {
|
||||
emit disconnected();
|
||||
} else if (status == HttpReady) {
|
||||
DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by socket disconnect").arg((_flags & MTPDdcOption_flag_ipv6) ? "IPv6" : "IPv4"));
|
||||
DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by socket disconnect").arg((_flags & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4"));
|
||||
status = UsingHttp;
|
||||
emit connected();
|
||||
}
|
||||
|
@ -748,7 +748,7 @@ void MTPautoConnection::disconnectFromServer() {
|
|||
}
|
||||
|
||||
void MTPautoConnection::connectToServer(const QString &addr, int32 port, int32 flags) {
|
||||
address = QUrl(((flags & MTPDdcOption_flag_ipv6) ? qsl("http://[%1]:%2/api") : qsl("http://%1:%2/api")).arg(addr).arg(80));//not p - always 80 port for http transport
|
||||
address = QUrl(((flags & MTPDdcOption::flag_ipv6) ? qsl("http://[%1]:%2/api") : qsl("http://%1:%2/api")).arg(addr).arg(80));//not p - always 80 port for http transport
|
||||
TCP_LOG(("HTTP Info: address is %1").arg(address.toDisplayString()));
|
||||
connect(&manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(requestFinished(QNetworkReply*)));
|
||||
|
||||
|
@ -761,7 +761,7 @@ void MTPautoConnection::connectToServer(const QString &addr, int32 port, int32 f
|
|||
|
||||
mtpBuffer buffer(_preparePQFake(httpNonce));
|
||||
|
||||
DEBUG_LOG(("Connection Info: sending fake req_pq through HTTP/%1 transport").arg((_flags & MTPDdcOption_flag_ipv6) ? "IPv6" : "IPv4"));
|
||||
DEBUG_LOG(("Connection Info: sending fake req_pq through HTTP/%1 transport").arg((_flags & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4"));
|
||||
|
||||
httpSend(buffer);
|
||||
}
|
||||
|
@ -797,7 +797,7 @@ void MTPautoConnection::requestFinished(QNetworkReply *reply) {
|
|||
status = HttpReady;
|
||||
httpStartTimer.start(MTPTcpConnectionWaitTimeout);
|
||||
} else {
|
||||
DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by pq-response, awaited").arg((_flags & MTPDdcOption_flag_ipv6) ? "IPv6" : "IPv4"));
|
||||
DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by pq-response, awaited").arg((_flags & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4"));
|
||||
status = UsingHttp;
|
||||
sock.disconnectFromHost();
|
||||
emit connected();
|
||||
|
@ -840,7 +840,7 @@ void MTPautoConnection::socketPacket(mtpPrime *packet, uint32 size) {
|
|||
status = WaitingHttp;
|
||||
sock.disconnectFromHost();
|
||||
} else if (status == HttpReady) {
|
||||
DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by bad tcp response, ready").arg((_flags & MTPDdcOption_flag_ipv6) ? "IPv6" : "IPv4"));
|
||||
DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by bad tcp response, ready").arg((_flags & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4"));
|
||||
status = UsingHttp;
|
||||
sock.disconnectFromHost();
|
||||
emit connected();
|
||||
|
@ -859,7 +859,7 @@ void MTPautoConnection::socketPacket(mtpPrime *packet, uint32 size) {
|
|||
MTPResPQ res_pq = _readPQFakeReply(data);
|
||||
const MTPDresPQ &res_pq_data(res_pq.c_resPQ());
|
||||
if (res_pq_data.vnonce == tcpNonce) {
|
||||
DEBUG_LOG(("Connection Info: TCP/%1-transport chosen by pq-response").arg((_flags & MTPDdcOption_flag_ipv6) ? "IPv6" : "IPv4"));
|
||||
DEBUG_LOG(("Connection Info: TCP/%1-transport chosen by pq-response").arg((_flags & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4"));
|
||||
status = UsingTcp;
|
||||
emit connected();
|
||||
}
|
||||
|
@ -869,7 +869,7 @@ void MTPautoConnection::socketPacket(mtpPrime *packet, uint32 size) {
|
|||
status = WaitingHttp;
|
||||
sock.disconnectFromHost();
|
||||
} else if (status == HttpReady) {
|
||||
DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by bad tcp response, awaited").arg((_flags & MTPDdcOption_flag_ipv6) ? "IPv6" : "IPv4"));
|
||||
DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by bad tcp response, awaited").arg((_flags & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4"));
|
||||
status = UsingHttp;
|
||||
sock.disconnectFromHost();
|
||||
emit connected();
|
||||
|
@ -909,7 +909,7 @@ void MTPautoConnection::socketError(QAbstractSocket::SocketError e) {
|
|||
if (status == WaitingBoth) {
|
||||
status = WaitingHttp;
|
||||
} else if (status == HttpReady) {
|
||||
DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by tcp error, ready").arg((_flags & MTPDdcOption_flag_ipv6) ? "IPv6" : "IPv4"));
|
||||
DEBUG_LOG(("Connection Info: HTTP/%1-transport chosen by tcp error, ready").arg((_flags & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4"));
|
||||
status = UsingHttp;
|
||||
emit connected();
|
||||
} else if (status == WaitingTcp || status == UsingTcp) {
|
||||
|
@ -938,7 +938,7 @@ void MTPtcpConnection::onSocketConnected() {
|
|||
if (status == WaitingTcp) {
|
||||
mtpBuffer buffer(_preparePQFake(tcpNonce));
|
||||
|
||||
DEBUG_LOG(("Connection Info: sending fake req_pq through TCP/%1 transport").arg((_flags & MTPDdcOption_flag_ipv6) ? "IPv6" : "IPv4"));
|
||||
DEBUG_LOG(("Connection Info: sending fake req_pq through TCP/%1 transport").arg((_flags & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4"));
|
||||
|
||||
if (_tcpTimeout < 0) _tcpTimeout = -_tcpTimeout;
|
||||
tcpTimeoutTimer.start(_tcpTimeout);
|
||||
|
@ -1027,7 +1027,7 @@ void MTPtcpConnection::socketPacket(mtpPrime *packet, uint32 size) {
|
|||
MTPResPQ res_pq = _readPQFakeReply(data);
|
||||
const MTPDresPQ &res_pq_data(res_pq.c_resPQ());
|
||||
if (res_pq_data.vnonce == tcpNonce) {
|
||||
DEBUG_LOG(("Connection Info: TCP/%1-transport chosen by pq-response").arg((_flags & MTPDdcOption_flag_ipv6) ? "IPv6" : "IPv4"));
|
||||
DEBUG_LOG(("Connection Info: TCP/%1-transport chosen by pq-response").arg((_flags & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4"));
|
||||
status = UsingTcp;
|
||||
emit connected();
|
||||
}
|
||||
|
@ -1100,7 +1100,7 @@ void MTPhttpConnection::disconnectFromServer() {
|
|||
}
|
||||
|
||||
void MTPhttpConnection::connectToServer(const QString &addr, int32 p, int32 flags) {
|
||||
address = QUrl(((flags & MTPDdcOption_flag_ipv6) ? qsl("http://[%1]:%2/api") : qsl("http://%1:%2/api")).arg(addr).arg(80));//not p - always 80 port for http transport
|
||||
address = QUrl(((flags & MTPDdcOption::flag_ipv6) ? qsl("http://[%1]:%2/api") : qsl("http://%1:%2/api")).arg(addr).arg(80));//not p - always 80 port for http transport
|
||||
TCP_LOG(("HTTP Info: address is %1").arg(address.toDisplayString()));
|
||||
connect(&manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(requestFinished(QNetworkReply*)));
|
||||
|
||||
|
@ -1108,7 +1108,7 @@ void MTPhttpConnection::connectToServer(const QString &addr, int32 p, int32 flag
|
|||
|
||||
mtpBuffer buffer(_preparePQFake(httpNonce));
|
||||
|
||||
DEBUG_LOG(("Connection Info: sending fake req_pq through HTTP/%1 transport").arg((flags & MTPDdcOption_flag_ipv6) ? "IPv6" : "IPv4"));
|
||||
DEBUG_LOG(("Connection Info: sending fake req_pq through HTTP/%1 transport").arg((flags & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4"));
|
||||
|
||||
sendData(buffer);
|
||||
}
|
||||
|
@ -1136,7 +1136,7 @@ void MTPhttpConnection::requestFinished(QNetworkReply *reply) {
|
|||
MTPResPQ res_pq = _readPQFakeReply(data);
|
||||
const MTPDresPQ &res_pq_data(res_pq.c_resPQ());
|
||||
if (res_pq_data.vnonce == httpNonce) {
|
||||
DEBUG_LOG(("Connection Info: HTTP/%1-transport connected by pq-response").arg((_flags & MTPDdcOption_flag_ipv6) ? "IPv6" : "IPv4"));
|
||||
DEBUG_LOG(("Connection Info: HTTP/%1-transport connected by pq-response").arg((_flags & MTPDdcOption::flag_ipv6) ? "IPv6" : "IPv4"));
|
||||
status = UsingHttp;
|
||||
emit connected();
|
||||
}
|
||||
|
@ -1905,7 +1905,7 @@ void MTProtoConnectionPrivate::socketStart(bool afterConfig) {
|
|||
flags4 = dcIndex4->flags;
|
||||
port4 = dcIndex4->port;
|
||||
}
|
||||
mtpDcOptions::const_iterator dcIndex6 = options.constFind((dc % _mtp_internal::dcShift) + (_mtp_internal::dcShift * MTPDdcOption_flag_ipv6));
|
||||
mtpDcOptions::const_iterator dcIndex6 = options.constFind((dc % _mtp_internal::dcShift) + (_mtp_internal::dcShift * MTPDdcOption::flag_ipv6));
|
||||
if (dcIndex6 != options.cend()) {
|
||||
ip6 = dcIndex6->ip;
|
||||
flags6 = dcIndex6->flags;
|
||||
|
|
|
@ -21,72 +21,6 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
|
|||
#pragma once
|
||||
|
||||
#include "mtproto/mtpCoreTypes.h"
|
||||
#include "mtproto/mtpScheme.h"
|
||||
|
||||
enum {
|
||||
MTPDmessage_flag_unread = (1 << 0),
|
||||
MTPDmessage_flag_out = (1 << 1),
|
||||
MTPDmessage_flag_notify_by_from = (1 << 4),
|
||||
MTPDmessage_flag_media_unread = (1 << 5),
|
||||
MTPDmessage_flag_HAS_TEXT_LINKS = (1 << 31), // client side flag for having links
|
||||
|
||||
MTPmessages_SendMessage_flag_skipWebPage = (1 << 1),
|
||||
MTPmessages_SendMessage_flag_broadcast = (1 << 4),
|
||||
|
||||
MTPmessages_ForwardMessages_flag_broadcast = (1 << 4),
|
||||
|
||||
MTPDdcOption_flag_ipv6 = (1 << 0),
|
||||
MTPDdcOption_flag_files = (1 << 1),
|
||||
|
||||
MTPDuser_flag_self = (1 << 10),
|
||||
MTPDuser_flag_contact = (1 << 11),
|
||||
MTPDuser_flag_mutual_contact = (1 << 12),
|
||||
MTPDuser_flag_deleted = (1 << 13),
|
||||
MTPDuser_flag_bot = (1 << 14),
|
||||
MTPDuser_flag_bot_reads_all = (1 << 15),
|
||||
MTPDuser_flag_bot_cant_join = (1 << 16),
|
||||
|
||||
MTPDreplyKeyboardMarkup_flag_resize = (1 << 0),
|
||||
MTPDreplyKeyboardMarkup_flag_single_use = (1 << 1),
|
||||
MTPDreplyKeyboardMarkup_flag_personal = (1 << 2),
|
||||
MTPDreplyKeyboardMarkup_flag_FORCE_REPLY = (1 << 30), // client side flag for forceReply
|
||||
MTPDreplyKeyboardMarkup_flag_ZERO = (1 << 31), // client side flag for zeroMarkup
|
||||
|
||||
MTPDstickerSet_flag_installed = (1 << 0),
|
||||
MTPDstickerSet_flag_disabled = (1 << 1),
|
||||
MTPDstickerSet_flag_official = (1 << 2),
|
||||
MTPDstickerSet_flag_NOT_LOADED = (1 << 31), // client side flag for not yet loaded set
|
||||
|
||||
MTPDchannel_flag_am_creator = (1 << 0),
|
||||
MTPDchannel_flag_was_kicked = (1 << 1),
|
||||
MTPDchannel_flag_have_left = (1 << 2),
|
||||
MTPDchannel_flag_am_editor = (1 << 3),
|
||||
MTPDchannel_flag_am_moderator = (1 << 4),
|
||||
MTPDchannel_flag_is_broadcast = (1 << 5),
|
||||
MTPDchannel_flag_is_verified = (1 << 7),
|
||||
|
||||
MTPDchannelFull_flag_can_view_participants = (1 << 3),
|
||||
|
||||
MTPDchat_flag_creator = (1 << 0),
|
||||
MTPDchat_flag_kicked = (1 << 1),
|
||||
MTPDchat_flag_left = (1 << 2),
|
||||
|
||||
MTPDchatInvite_flag_is_channel = (1 << 0),
|
||||
MTPDchatInvite_flag_is_broadcast = (1 << 1),
|
||||
MTPDchatInvite_flag_is_public = (1 << 2),
|
||||
|
||||
MTPupdates_ChannelDifference_flag_final = (1 << 0),
|
||||
|
||||
MTPDchannelMessagesFilter_flag_only_important = (1 << 0),
|
||||
|
||||
MTPmessages_CreateChannel_flag_broadcast = (1 << 0),
|
||||
|
||||
MTPmessages_Search_flag_only_important = (1 << 0),
|
||||
};
|
||||
|
||||
static const MTPReplyMarkup MTPnullMarkup = MTP_replyKeyboardMarkup(MTP_int(0), MTP_vector<MTPKeyboardButtonRow>(0));
|
||||
static const MTPVector<MTPMessageEntity> MTPnullEntities = MTP_vector<MTPMessageEntity>(0);
|
||||
|
||||
#include "mtproto/mtpPublicRSA.h"
|
||||
#include "mtproto/mtpAuthKey.h"
|
||||
|
||||
|
|
|
@ -67,12 +67,6 @@ void mtpTextSerializeCore(MTPStringLogger &to, const mtpPrime *&from, const mtpP
|
|||
}
|
||||
} break;
|
||||
|
||||
case mtpc_boolTrue:
|
||||
case mtpc_boolFalse: {
|
||||
MTPbool value(from, end, cons);
|
||||
to.add(value.v ? "[TRUE]" : "[FALSE]");
|
||||
} break;
|
||||
|
||||
case mtpc_vector: {
|
||||
if (from >= end) {
|
||||
throw Exception("from >= end in vector");
|
||||
|
|
|
@ -317,8 +317,6 @@ enum {
|
|||
mtpc_double = 0x2210c154,
|
||||
mtpc_string = 0xb5286e24,
|
||||
|
||||
mtpc_boolTrue = 0x997275b5,
|
||||
mtpc_boolFalse = 0xbc799737,
|
||||
mtpc_vector = 0x1cb5c415,
|
||||
|
||||
// layers
|
||||
|
@ -370,7 +368,7 @@ static const mtpTypeId mtpLayers[] = {
|
|||
mtpTypeId(mtpc_invokeWithLayer18),
|
||||
};
|
||||
static const uint32 mtpLayerMaxSingle = sizeof(mtpLayers) / sizeof(mtpLayers[0]);
|
||||
static const mtpPrime mtpCurrentLayer = 38;
|
||||
static const mtpPrime mtpCurrentLayer = 40;
|
||||
|
||||
template <typename bareT>
|
||||
class MTPBoxed : public bareT {
|
||||
|
@ -773,56 +771,6 @@ inline QByteArray qba(const MTPstring &v) {
|
|||
return QByteArray(d.data(), d.length());
|
||||
}
|
||||
|
||||
class MTPbool {
|
||||
public:
|
||||
bool v;
|
||||
|
||||
MTPbool() {
|
||||
}
|
||||
MTPbool(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) {
|
||||
read(from, end, cons);
|
||||
}
|
||||
|
||||
uint32 innerLength() const {
|
||||
return 0;
|
||||
}
|
||||
mtpTypeId type() const {
|
||||
return v ? mtpc_boolTrue : mtpc_boolFalse;
|
||||
}
|
||||
void read(const mtpPrime *& /*from*/, const mtpPrime * /*end*/, mtpTypeId cons) {
|
||||
switch (cons) {
|
||||
case mtpc_boolFalse: v = false; break;
|
||||
case mtpc_boolTrue: v = true; break;
|
||||
default: throw mtpErrorUnexpected(cons, "MTPbool");
|
||||
}
|
||||
}
|
||||
void write(mtpBuffer & /*to*/) const {
|
||||
}
|
||||
|
||||
private:
|
||||
explicit MTPbool(bool val) : v(val) {
|
||||
}
|
||||
|
||||
friend MTPbool MTP_bool(bool v);
|
||||
};
|
||||
inline MTPbool MTP_bool(bool v) {
|
||||
return MTPbool(v);
|
||||
}
|
||||
inline MTPbool MTP_boolFalse() {
|
||||
return MTP_bool(false);
|
||||
}
|
||||
inline MTPbool MTP_boolTrue() {
|
||||
return MTP_bool(true);
|
||||
}
|
||||
typedef MTPBoxed<MTPbool> MTPBool;
|
||||
|
||||
inline bool operator==(const MTPbool &a, const MTPbool &b) {
|
||||
return a.v == b.v;
|
||||
}
|
||||
inline bool operator!=(const MTPbool &a, const MTPbool &b) {
|
||||
return a.v != b.v;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
class MTPDvector : public mtpDataImpl<MTPDvector<T> > {
|
||||
public:
|
||||
|
@ -1018,3 +966,27 @@ inline QString mtpTextSerialize(const mtpPrime *&from, const mtpPrime *end) {
|
|||
}
|
||||
|
||||
#endif
|
||||
|
||||
#include "mtpScheme.h"
|
||||
|
||||
inline MTPbool MTP_bool(bool v) {
|
||||
return v ? MTP_boolTrue() : MTP_boolFalse();
|
||||
}
|
||||
|
||||
inline bool mtpIsTrue(const MTPBool &v) {
|
||||
return v.type() == mtpc_boolTrue;
|
||||
}
|
||||
inline bool mtpIsFalse(const MTPBool &v) {
|
||||
return !mtpIsTrue(v);
|
||||
}
|
||||
|
||||
enum { // client side flags
|
||||
MTPDmessage_flag_HAS_TEXT_LINKS = (1 << 31), // message has links for "shared links" indexing
|
||||
MTPmessages_SendMessage_flag_broadcast = (1 << 4),
|
||||
MTPDreplyKeyboardMarkup_flag_FORCE_REPLY = (1 << 30), // markup just wants a text reply
|
||||
MTPDreplyKeyboardMarkup_flag_ZERO = (1 << 31), // none (zero) markup
|
||||
MTPDstickerSet_flag_NOT_LOADED = (1 << 31), // sticker set is not yet loaded
|
||||
};
|
||||
|
||||
static const MTPReplyMarkup MTPnullMarkup = MTP_replyKeyboardMarkup(MTP_int(0), MTP_vector<MTPKeyboardButtonRow>(0));
|
||||
static const MTPVector<MTPMessageEntity> MTPnullEntities = MTP_vector<MTPMessageEntity>(0);
|
||||
|
|
|
@ -149,7 +149,7 @@ namespace {
|
|||
|
||||
const MTPDconfig &data(result.c_config());
|
||||
|
||||
DEBUG_LOG(("MTP Info: got config, chat_size_max: %1, date: %2, test_mode: %3, this_dc: %4, dc_options.length: %5").arg(data.vchat_size_max.v).arg(data.vdate.v).arg(data.vtest_mode.v).arg(data.vthis_dc.v).arg(data.vdc_options.c_vector().v.size()));
|
||||
DEBUG_LOG(("MTP Info: got config, chat_size_max: %1, date: %2, test_mode: %3, this_dc: %4, dc_options.length: %5").arg(data.vchat_size_max.v).arg(data.vdate.v).arg(mtpIsTrue(data.vtest_mode)).arg(data.vthis_dc.v).arg(data.vdc_options.c_vector().v.size()));
|
||||
|
||||
mtpUpdateDcOptions(data.vdc_options.c_vector().v);
|
||||
cSetMaxGroupCount(data.vchat_size_max.v);
|
||||
|
|
|
@ -17,7 +17,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|||
GNU General Public License for more details.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#include "stdafx.h"
|
||||
#include "mtpScheme.h"
|
||||
|
@ -436,6 +436,18 @@ void _serialize_http_wait(MTPStringLogger &to, int32 stage, int32 lev, Types &ty
|
|||
}
|
||||
}
|
||||
|
||||
void _serialize_boolFalse(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) {
|
||||
to.add("{ boolFalse }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back();
|
||||
}
|
||||
|
||||
void _serialize_boolTrue(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) {
|
||||
to.add("{ boolTrue }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back();
|
||||
}
|
||||
|
||||
void _serialize_true(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) {
|
||||
to.add("{ true }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back();
|
||||
}
|
||||
|
||||
void _serialize_error(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) {
|
||||
if (stage) {
|
||||
to.add(",\n").addSpaces(lev);
|
||||
|
@ -1096,15 +1108,23 @@ void _serialize_user(MTPStringLogger &to, int32 stage, int32 lev, Types &types,
|
|||
}
|
||||
switch (stage) {
|
||||
case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 2: to.add(" access_hash: "); ++stages.back(); if (flag & MTPDuser::flag_access_hash) { types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break;
|
||||
case 3: to.add(" first_name: "); ++stages.back(); if (flag & MTPDuser::flag_first_name) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break;
|
||||
case 4: to.add(" last_name: "); ++stages.back(); if (flag & MTPDuser::flag_last_name) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break;
|
||||
case 5: to.add(" username: "); ++stages.back(); if (flag & MTPDuser::flag_username) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break;
|
||||
case 6: to.add(" phone: "); ++stages.back(); if (flag & MTPDuser::flag_phone) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break;
|
||||
case 7: to.add(" photo: "); ++stages.back(); if (flag & MTPDuser::flag_photo) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break;
|
||||
case 8: to.add(" status: "); ++stages.back(); if (flag & MTPDuser::flag_status) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break;
|
||||
case 9: to.add(" bot_info_version: "); ++stages.back(); if (flag & MTPDuser::flag_bot_info_version) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 14 IN FIELD flags ]"); } break;
|
||||
case 1: to.add(" self: "); ++stages.back(); if (flag & MTPDuser::flag_self) { to.add("NO [ BY BIT 10 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 10 IN FIELD flags ]"); } break;
|
||||
case 2: to.add(" contact: "); ++stages.back(); if (flag & MTPDuser::flag_contact) { to.add("NO [ BY BIT 11 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 11 IN FIELD flags ]"); } break;
|
||||
case 3: to.add(" mutual_contact: "); ++stages.back(); if (flag & MTPDuser::flag_mutual_contact) { to.add("NO [ BY BIT 12 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 12 IN FIELD flags ]"); } break;
|
||||
case 4: to.add(" deleted: "); ++stages.back(); if (flag & MTPDuser::flag_deleted) { to.add("NO [ BY BIT 13 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 13 IN FIELD flags ]"); } break;
|
||||
case 5: to.add(" bot: "); ++stages.back(); if (flag & MTPDuser::flag_bot) { to.add("NO [ BY BIT 14 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 14 IN FIELD flags ]"); } break;
|
||||
case 6: to.add(" bot_chat_history: "); ++stages.back(); if (flag & MTPDuser::flag_bot_chat_history) { to.add("NO [ BY BIT 15 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 15 IN FIELD flags ]"); } break;
|
||||
case 7: to.add(" bot_nochats: "); ++stages.back(); if (flag & MTPDuser::flag_bot_nochats) { to.add("NO [ BY BIT 16 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 16 IN FIELD flags ]"); } break;
|
||||
case 8: to.add(" verified: "); ++stages.back(); if (flag & MTPDuser::flag_verified) { to.add("NO [ BY BIT 17 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 17 IN FIELD flags ]"); } break;
|
||||
case 9: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 10: to.add(" access_hash: "); ++stages.back(); if (flag & MTPDuser::flag_access_hash) { types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break;
|
||||
case 11: to.add(" first_name: "); ++stages.back(); if (flag & MTPDuser::flag_first_name) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break;
|
||||
case 12: to.add(" last_name: "); ++stages.back(); if (flag & MTPDuser::flag_last_name) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break;
|
||||
case 13: to.add(" username: "); ++stages.back(); if (flag & MTPDuser::flag_username) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break;
|
||||
case 14: to.add(" phone: "); ++stages.back(); if (flag & MTPDuser::flag_phone) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break;
|
||||
case 15: to.add(" photo: "); ++stages.back(); if (flag & MTPDuser::flag_photo) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break;
|
||||
case 16: to.add(" status: "); ++stages.back(); if (flag & MTPDuser::flag_status) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break;
|
||||
case 17: to.add(" bot_info_version: "); ++stages.back(); if (flag & MTPDuser::flag_bot_info_version) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 14 IN FIELD flags ]"); } break;
|
||||
default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break;
|
||||
}
|
||||
}
|
||||
|
@ -1192,12 +1212,17 @@ void _serialize_chat(MTPStringLogger &to, int32 stage, int32 lev, Types &types,
|
|||
}
|
||||
switch (stage) {
|
||||
case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 2: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 3: to.add(" photo: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 4: to.add(" participants_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 5: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 6: to.add(" version: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" creator: "); ++stages.back(); if (flag & MTPDchat::flag_creator) { to.add("NO [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break;
|
||||
case 2: to.add(" kicked: "); ++stages.back(); if (flag & MTPDchat::flag_kicked) { to.add("NO [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break;
|
||||
case 3: to.add(" left: "); ++stages.back(); if (flag & MTPDchat::flag_left) { to.add("NO [ BY BIT 2 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break;
|
||||
case 4: to.add(" has_admins: "); ++stages.back(); if (flag & MTPDchat::flag_has_admins) { to.add("NO [ BY BIT 3 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break;
|
||||
case 5: to.add(" admin: "); ++stages.back(); if (flag & MTPDchat::flag_admin) { to.add("NO [ BY BIT 4 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break;
|
||||
case 6: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 7: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 8: to.add(" photo: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 9: to.add(" participants_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 10: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 11: to.add(" version: "); ++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;
|
||||
}
|
||||
}
|
||||
|
@ -1225,13 +1250,20 @@ void _serialize_channel(MTPStringLogger &to, int32 stage, int32 lev, Types &type
|
|||
}
|
||||
switch (stage) {
|
||||
case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 2: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 3: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 4: to.add(" username: "); ++stages.back(); if (flag & MTPDchannel::flag_username) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break;
|
||||
case 5: to.add(" photo: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 6: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 7: to.add(" version: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" creator: "); ++stages.back(); if (flag & MTPDchannel::flag_creator) { to.add("NO [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break;
|
||||
case 2: to.add(" kicked: "); ++stages.back(); if (flag & MTPDchannel::flag_kicked) { to.add("NO [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break;
|
||||
case 3: to.add(" left: "); ++stages.back(); if (flag & MTPDchannel::flag_left) { to.add("NO [ BY BIT 2 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break;
|
||||
case 4: to.add(" editor: "); ++stages.back(); if (flag & MTPDchannel::flag_editor) { to.add("NO [ BY BIT 3 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break;
|
||||
case 5: to.add(" moderator: "); ++stages.back(); if (flag & MTPDchannel::flag_moderator) { to.add("NO [ BY BIT 4 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break;
|
||||
case 6: to.add(" broadcast: "); ++stages.back(); if (flag & MTPDchannel::flag_broadcast) { to.add("NO [ BY BIT 5 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break;
|
||||
case 7: to.add(" verified: "); ++stages.back(); if (flag & MTPDchannel::flag_verified) { to.add("NO [ BY BIT 7 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 7 IN FIELD flags ]"); } break;
|
||||
case 8: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 9: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 10: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 11: to.add(" username: "); ++stages.back(); if (flag & MTPDchannel::flag_username) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break;
|
||||
case 12: to.add(" photo: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 13: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 14: to.add(" version: "); ++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;
|
||||
}
|
||||
}
|
||||
|
@ -1278,17 +1310,18 @@ void _serialize_channelFull(MTPStringLogger &to, int32 stage, int32 lev, Types &
|
|||
}
|
||||
switch (stage) {
|
||||
case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 2: to.add(" about: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 3: to.add(" participants_count: "); ++stages.back(); if (flag & MTPDchannelFull::flag_participants_count) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break;
|
||||
case 4: to.add(" admins_count: "); ++stages.back(); if (flag & MTPDchannelFull::flag_admins_count) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break;
|
||||
case 5: to.add(" kicked_count: "); ++stages.back(); if (flag & MTPDchannelFull::flag_kicked_count) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break;
|
||||
case 6: to.add(" read_inbox_max_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 7: to.add(" unread_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 8: to.add(" unread_important_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 9: to.add(" chat_photo: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 10: to.add(" notify_settings: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 11: to.add(" exported_invite: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" can_view_participants: "); ++stages.back(); if (flag & MTPDchannelFull::flag_can_view_participants) { to.add("NO [ BY BIT 3 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break;
|
||||
case 2: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 3: to.add(" about: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 4: to.add(" participants_count: "); ++stages.back(); if (flag & MTPDchannelFull::flag_participants_count) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break;
|
||||
case 5: to.add(" admins_count: "); ++stages.back(); if (flag & MTPDchannelFull::flag_admins_count) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break;
|
||||
case 6: to.add(" kicked_count: "); ++stages.back(); if (flag & MTPDchannelFull::flag_kicked_count) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break;
|
||||
case 7: to.add(" read_inbox_max_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 8: to.add(" unread_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 9: to.add(" unread_important_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 10: to.add(" chat_photo: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 11: to.add(" notify_settings: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 12: to.add(" exported_invite: "); ++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;
|
||||
}
|
||||
}
|
||||
|
@ -1308,6 +1341,34 @@ void _serialize_chatParticipant(MTPStringLogger &to, int32 stage, int32 lev, Typ
|
|||
}
|
||||
}
|
||||
|
||||
void _serialize_chatParticipantCreator(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) {
|
||||
if (stage) {
|
||||
to.add(",\n").addSpaces(lev);
|
||||
} else {
|
||||
to.add("{ chatParticipantCreator");
|
||||
to.add("\n").addSpaces(lev);
|
||||
}
|
||||
switch (stage) {
|
||||
case 0: to.add(" user_id: "); ++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;
|
||||
}
|
||||
}
|
||||
|
||||
void _serialize_chatParticipantAdmin(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) {
|
||||
if (stage) {
|
||||
to.add(",\n").addSpaces(lev);
|
||||
} else {
|
||||
to.add("{ chatParticipantAdmin");
|
||||
to.add("\n").addSpaces(lev);
|
||||
}
|
||||
switch (stage) {
|
||||
case 0: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" inviter_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 2: to.add(" date: "); ++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;
|
||||
}
|
||||
}
|
||||
|
||||
void _serialize_chatParticipantsForbidden(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) {
|
||||
if (stage) {
|
||||
to.add(",\n").addSpaces(lev);
|
||||
|
@ -1379,18 +1440,22 @@ void _serialize_message(MTPStringLogger &to, int32 stage, int32 lev, Types &type
|
|||
}
|
||||
switch (stage) {
|
||||
case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 2: to.add(" from_id: "); ++stages.back(); if (flag & MTPDmessage::flag_from_id) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 8 IN FIELD flags ]"); } break;
|
||||
case 3: to.add(" to_id: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 4: to.add(" fwd_from_id: "); ++stages.back(); if (flag & MTPDmessage::flag_fwd_from_id) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break;
|
||||
case 5: to.add(" fwd_date: "); ++stages.back(); if (flag & MTPDmessage::flag_fwd_date) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break;
|
||||
case 6: to.add(" reply_to_msg_id: "); ++stages.back(); if (flag & MTPDmessage::flag_reply_to_msg_id) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break;
|
||||
case 7: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 8: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 9: to.add(" media: "); ++stages.back(); if (flag & MTPDmessage::flag_media) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 9 IN FIELD flags ]"); } break;
|
||||
case 10: to.add(" reply_markup: "); ++stages.back(); if (flag & MTPDmessage::flag_reply_markup) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break;
|
||||
case 11: to.add(" entities: "); ++stages.back(); if (flag & MTPDmessage::flag_entities) { types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 7 IN FIELD flags ]"); } break;
|
||||
case 12: to.add(" views: "); ++stages.back(); if (flag & MTPDmessage::flag_views) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 10 IN FIELD flags ]"); } break;
|
||||
case 1: to.add(" unread: "); ++stages.back(); if (flag & MTPDmessage::flag_unread) { to.add("NO [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break;
|
||||
case 2: to.add(" out: "); ++stages.back(); if (flag & MTPDmessage::flag_out) { to.add("NO [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break;
|
||||
case 3: to.add(" mentioned: "); ++stages.back(); if (flag & MTPDmessage::flag_mentioned) { to.add("NO [ BY BIT 4 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break;
|
||||
case 4: to.add(" media_unread: "); ++stages.back(); if (flag & MTPDmessage::flag_media_unread) { to.add("NO [ BY BIT 5 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break;
|
||||
case 5: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 6: to.add(" from_id: "); ++stages.back(); if (flag & MTPDmessage::flag_from_id) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 8 IN FIELD flags ]"); } break;
|
||||
case 7: to.add(" to_id: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 8: to.add(" fwd_from_id: "); ++stages.back(); if (flag & MTPDmessage::flag_fwd_from_id) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break;
|
||||
case 9: to.add(" fwd_date: "); ++stages.back(); if (flag & MTPDmessage::flag_fwd_date) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break;
|
||||
case 10: to.add(" reply_to_msg_id: "); ++stages.back(); if (flag & MTPDmessage::flag_reply_to_msg_id) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break;
|
||||
case 11: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 12: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 13: to.add(" media: "); ++stages.back(); if (flag & MTPDmessage::flag_media) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 9 IN FIELD flags ]"); } break;
|
||||
case 14: to.add(" reply_markup: "); ++stages.back(); if (flag & MTPDmessage::flag_reply_markup) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break;
|
||||
case 15: to.add(" entities: "); ++stages.back(); if (flag & MTPDmessage::flag_entities) { types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 7 IN FIELD flags ]"); } break;
|
||||
case 16: to.add(" views: "); ++stages.back(); if (flag & MTPDmessage::flag_views) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 10 IN FIELD flags ]"); } break;
|
||||
default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break;
|
||||
}
|
||||
}
|
||||
|
@ -1404,11 +1469,15 @@ void _serialize_messageService(MTPStringLogger &to, int32 stage, int32 lev, Type
|
|||
}
|
||||
switch (stage) {
|
||||
case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 2: to.add(" from_id: "); ++stages.back(); if (flag & MTPDmessageService::flag_from_id) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 8 IN FIELD flags ]"); } break;
|
||||
case 3: to.add(" to_id: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 4: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 5: to.add(" action: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" unread: "); ++stages.back(); if (flag & MTPDmessageService::flag_unread) { to.add("NO [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break;
|
||||
case 2: to.add(" out: "); ++stages.back(); if (flag & MTPDmessageService::flag_out) { to.add("NO [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break;
|
||||
case 3: to.add(" mentioned: "); ++stages.back(); if (flag & MTPDmessageService::flag_mentioned) { to.add("NO [ BY BIT 4 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break;
|
||||
case 4: to.add(" media_unread: "); ++stages.back(); if (flag & MTPDmessageService::flag_media_unread) { to.add("NO [ BY BIT 5 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break;
|
||||
case 5: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 6: to.add(" from_id: "); ++stages.back(); if (flag & MTPDmessageService::flag_from_id) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 8 IN FIELD flags ]"); } break;
|
||||
case 7: to.add(" to_id: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 8: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 9: to.add(" action: "); ++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;
|
||||
}
|
||||
}
|
||||
|
@ -2914,16 +2983,20 @@ void _serialize_updateShortMessage(MTPStringLogger &to, int32 stage, int32 lev,
|
|||
}
|
||||
switch (stage) {
|
||||
case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 2: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 3: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 4: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 5: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 6: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 7: to.add(" fwd_from_id: "); ++stages.back(); if (flag & MTPDupdateShortMessage::flag_fwd_from_id) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break;
|
||||
case 8: to.add(" fwd_date: "); ++stages.back(); if (flag & MTPDupdateShortMessage::flag_fwd_date) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break;
|
||||
case 9: to.add(" reply_to_msg_id: "); ++stages.back(); if (flag & MTPDupdateShortMessage::flag_reply_to_msg_id) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break;
|
||||
case 10: to.add(" entities: "); ++stages.back(); if (flag & MTPDupdateShortMessage::flag_entities) { types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 7 IN FIELD flags ]"); } break;
|
||||
case 1: to.add(" unread: "); ++stages.back(); if (flag & MTPDupdateShortMessage::flag_unread) { to.add("NO [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break;
|
||||
case 2: to.add(" out: "); ++stages.back(); if (flag & MTPDupdateShortMessage::flag_out) { to.add("NO [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break;
|
||||
case 3: to.add(" mentioned: "); ++stages.back(); if (flag & MTPDupdateShortMessage::flag_mentioned) { to.add("NO [ BY BIT 4 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break;
|
||||
case 4: to.add(" media_unread: "); ++stages.back(); if (flag & MTPDupdateShortMessage::flag_media_unread) { to.add("NO [ BY BIT 5 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break;
|
||||
case 5: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 6: to.add(" user_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 7: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 8: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 9: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 10: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 11: to.add(" fwd_from_id: "); ++stages.back(); if (flag & MTPDupdateShortMessage::flag_fwd_from_id) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break;
|
||||
case 12: to.add(" fwd_date: "); ++stages.back(); if (flag & MTPDupdateShortMessage::flag_fwd_date) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break;
|
||||
case 13: to.add(" reply_to_msg_id: "); ++stages.back(); if (flag & MTPDupdateShortMessage::flag_reply_to_msg_id) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break;
|
||||
case 14: to.add(" entities: "); ++stages.back(); if (flag & MTPDupdateShortMessage::flag_entities) { types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 7 IN FIELD flags ]"); } break;
|
||||
default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break;
|
||||
}
|
||||
}
|
||||
|
@ -2937,17 +3010,21 @@ void _serialize_updateShortChatMessage(MTPStringLogger &to, int32 stage, int32 l
|
|||
}
|
||||
switch (stage) {
|
||||
case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 2: to.add(" from_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 3: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 4: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 5: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 6: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 7: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 8: to.add(" fwd_from_id: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::flag_fwd_from_id) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break;
|
||||
case 9: to.add(" fwd_date: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::flag_fwd_date) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break;
|
||||
case 10: to.add(" reply_to_msg_id: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::flag_reply_to_msg_id) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break;
|
||||
case 11: to.add(" entities: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::flag_entities) { types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 7 IN FIELD flags ]"); } break;
|
||||
case 1: to.add(" unread: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::flag_unread) { to.add("NO [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break;
|
||||
case 2: to.add(" out: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::flag_out) { to.add("NO [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break;
|
||||
case 3: to.add(" mentioned: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::flag_mentioned) { to.add("NO [ BY BIT 4 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break;
|
||||
case 4: to.add(" media_unread: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::flag_media_unread) { to.add("NO [ BY BIT 5 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 5 IN FIELD flags ]"); } break;
|
||||
case 5: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 6: to.add(" from_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 7: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 8: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 9: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 10: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 11: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 12: to.add(" fwd_from_id: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::flag_fwd_from_id) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break;
|
||||
case 13: to.add(" fwd_date: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::flag_fwd_date) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break;
|
||||
case 14: to.add(" reply_to_msg_id: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::flag_reply_to_msg_id) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break;
|
||||
case 15: to.add(" entities: "); ++stages.back(); if (flag & MTPDupdateShortChatMessage::flag_entities) { types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 7 IN FIELD flags ]"); } break;
|
||||
default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break;
|
||||
}
|
||||
}
|
||||
|
@ -3010,12 +3087,14 @@ void _serialize_updateShortSentMessage(MTPStringLogger &to, int32 stage, int32 l
|
|||
}
|
||||
switch (stage) {
|
||||
case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" id: "); ++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: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 3: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 4: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 5: to.add(" media: "); ++stages.back(); if (flag & MTPDupdateShortSentMessage::flag_media) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 9 IN FIELD flags ]"); } break;
|
||||
case 6: to.add(" entities: "); ++stages.back(); if (flag & MTPDupdateShortSentMessage::flag_entities) { types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 7 IN FIELD flags ]"); } break;
|
||||
case 1: to.add(" unread: "); ++stages.back(); if (flag & MTPDupdateShortSentMessage::flag_unread) { to.add("NO [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break;
|
||||
case 2: to.add(" out: "); ++stages.back(); if (flag & MTPDupdateShortSentMessage::flag_out) { to.add("NO [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break;
|
||||
case 3: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 4: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 5: to.add(" pts_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 6: to.add(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 7: to.add(" media: "); ++stages.back(); if (flag & MTPDupdateShortSentMessage::flag_media) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 9 IN FIELD flags ]"); } break;
|
||||
case 8: to.add(" entities: "); ++stages.back(); if (flag & MTPDupdateShortSentMessage::flag_entities) { types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 7 IN FIELD flags ]"); } break;
|
||||
default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break;
|
||||
}
|
||||
}
|
||||
|
@ -3087,9 +3166,11 @@ void _serialize_dcOption(MTPStringLogger &to, int32 stage, int32 lev, Types &typ
|
|||
}
|
||||
switch (stage) {
|
||||
case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 2: to.add(" ip_address: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 3: to.add(" port: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" ipv6: "); ++stages.back(); if (flag & MTPDdcOption::flag_ipv6) { to.add("NO [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break;
|
||||
case 2: to.add(" media_only: "); ++stages.back(); if (flag & MTPDdcOption::flag_media_only) { to.add("NO [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break;
|
||||
case 3: to.add(" id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 4: to.add(" ip_address: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 5: to.add(" port: "); ++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;
|
||||
}
|
||||
}
|
||||
|
@ -4178,7 +4259,10 @@ void _serialize_chatInvite(MTPStringLogger &to, int32 stage, int32 lev, Types &t
|
|||
}
|
||||
switch (stage) {
|
||||
case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" channel: "); ++stages.back(); if (flag & MTPDchatInvite::flag_channel) { to.add("NO [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break;
|
||||
case 2: to.add(" broadcast: "); ++stages.back(); if (flag & MTPDchatInvite::flag_broadcast) { to.add("NO [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break;
|
||||
case 3: to.add(" public: "); ++stages.back(); if (flag & MTPDchatInvite::flag_public) { to.add("NO [ BY BIT 2 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break;
|
||||
case 4: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); 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;
|
||||
}
|
||||
}
|
||||
|
@ -4223,12 +4307,15 @@ void _serialize_stickerSet(MTPStringLogger &to, int32 stage, int32 lev, Types &t
|
|||
}
|
||||
switch (stage) {
|
||||
case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 2: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 3: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 4: to.add(" short_name: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 5: to.add(" count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 6: to.add(" hash: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" installed: "); ++stages.back(); if (flag & MTPDstickerSet::flag_installed) { to.add("NO [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break;
|
||||
case 2: to.add(" disabled: "); ++stages.back(); if (flag & MTPDstickerSet::flag_disabled) { to.add("NO [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break;
|
||||
case 3: to.add(" official: "); ++stages.back(); if (flag & MTPDstickerSet::flag_official) { to.add("NO [ BY BIT 2 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break;
|
||||
case 4: to.add(" id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 5: to.add(" access_hash: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 6: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 7: to.add(" short_name: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 8: to.add(" count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 9: to.add(" hash: "); ++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;
|
||||
}
|
||||
}
|
||||
|
@ -4318,6 +4405,7 @@ void _serialize_replyKeyboardHide(MTPStringLogger &to, int32 stage, int32 lev, T
|
|||
}
|
||||
switch (stage) {
|
||||
case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" selective: "); ++stages.back(); if (flag & MTPDreplyKeyboardHide::flag_selective) { to.add("NO [ BY BIT 2 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break;
|
||||
default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break;
|
||||
}
|
||||
}
|
||||
|
@ -4331,6 +4419,8 @@ void _serialize_replyKeyboardForceReply(MTPStringLogger &to, int32 stage, int32
|
|||
}
|
||||
switch (stage) {
|
||||
case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" single_use: "); ++stages.back(); if (flag & MTPDreplyKeyboardForceReply::flag_single_use) { to.add("NO [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break;
|
||||
case 2: to.add(" selective: "); ++stages.back(); if (flag & MTPDreplyKeyboardForceReply::flag_selective) { to.add("NO [ BY BIT 2 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break;
|
||||
default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break;
|
||||
}
|
||||
}
|
||||
|
@ -4344,7 +4434,10 @@ void _serialize_replyKeyboardMarkup(MTPStringLogger &to, int32 stage, int32 lev,
|
|||
}
|
||||
switch (stage) {
|
||||
case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" rows: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" resize: "); ++stages.back(); if (flag & MTPDreplyKeyboardMarkup::flag_resize) { to.add("NO [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break;
|
||||
case 2: to.add(" single_use: "); ++stages.back(); if (flag & MTPDreplyKeyboardMarkup::flag_single_use) { to.add("NO [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break;
|
||||
case 3: to.add(" selective: "); ++stages.back(); if (flag & MTPDreplyKeyboardMarkup::flag_selective) { to.add("NO [ BY BIT 2 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break;
|
||||
case 4: to.add(" rows: "); ++stages.back(); types.push_back(00); 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;
|
||||
}
|
||||
}
|
||||
|
@ -4594,8 +4687,9 @@ void _serialize_updates_channelDifferenceEmpty(MTPStringLogger &to, int32 stage,
|
|||
}
|
||||
switch (stage) {
|
||||
case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); 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(" timeout: "); ++stages.back(); if (flag & MTPDupdates_channelDifferenceEmpty::flag_timeout) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break;
|
||||
case 1: to.add(" final: "); ++stages.back(); if (flag & MTPDupdates_channelDifferenceEmpty::flag_final) { to.add("NO [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break;
|
||||
case 2: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 3: to.add(" timeout: "); ++stages.back(); if (flag & MTPDupdates_channelDifferenceEmpty::flag_timeout) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break;
|
||||
default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break;
|
||||
}
|
||||
}
|
||||
|
@ -4609,16 +4703,17 @@ void _serialize_updates_channelDifferenceTooLong(MTPStringLogger &to, int32 stag
|
|||
}
|
||||
switch (stage) {
|
||||
case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); 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(" timeout: "); ++stages.back(); if (flag & MTPDupdates_channelDifferenceTooLong::flag_timeout) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break;
|
||||
case 3: to.add(" top_message: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 4: to.add(" top_important_message: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 5: to.add(" read_inbox_max_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 6: to.add(" unread_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 7: to.add(" unread_important_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 8: to.add(" messages: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 9: to.add(" chats: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 10: to.add(" users: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" final: "); ++stages.back(); if (flag & MTPDupdates_channelDifferenceTooLong::flag_final) { to.add("NO [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break;
|
||||
case 2: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 3: to.add(" timeout: "); ++stages.back(); if (flag & MTPDupdates_channelDifferenceTooLong::flag_timeout) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break;
|
||||
case 4: to.add(" top_message: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 5: to.add(" top_important_message: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 6: to.add(" read_inbox_max_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 7: to.add(" unread_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 8: to.add(" unread_important_count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 9: to.add(" messages: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 10: to.add(" chats: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 11: to.add(" users: "); ++stages.back(); types.push_back(00); 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;
|
||||
}
|
||||
}
|
||||
|
@ -4632,12 +4727,13 @@ void _serialize_updates_channelDifference(MTPStringLogger &to, int32 stage, int3
|
|||
}
|
||||
switch (stage) {
|
||||
case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); 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(" timeout: "); ++stages.back(); if (flag & MTPDupdates_channelDifference::flag_timeout) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break;
|
||||
case 3: to.add(" new_messages: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 4: to.add(" other_updates: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 5: to.add(" chats: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 6: to.add(" users: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" final: "); ++stages.back(); if (flag & MTPDupdates_channelDifference::flag_final) { to.add("NO [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break;
|
||||
case 2: to.add(" pts: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 3: to.add(" timeout: "); ++stages.back(); if (flag & MTPDupdates_channelDifference::flag_timeout) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break;
|
||||
case 4: to.add(" new_messages: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 5: to.add(" other_updates: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 6: to.add(" chats: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 7: to.add(" users: "); ++stages.back(); types.push_back(00); 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;
|
||||
}
|
||||
}
|
||||
|
@ -4655,7 +4751,8 @@ void _serialize_channelMessagesFilter(MTPStringLogger &to, int32 stage, int32 le
|
|||
}
|
||||
switch (stage) {
|
||||
case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" ranges: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" important_only: "); ++stages.back(); if (flag & MTPDchannelMessagesFilter::flag_important_only) { to.add("NO [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break;
|
||||
case 2: to.add(" ranges: "); ++stages.back(); types.push_back(00); 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;
|
||||
}
|
||||
}
|
||||
|
@ -5276,6 +5373,21 @@ void _serialize_messages_uninstallStickerSet(MTPStringLogger &to, int32 stage, i
|
|||
}
|
||||
}
|
||||
|
||||
void _serialize_messages_editChatAdmin(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) {
|
||||
if (stage) {
|
||||
to.add(",\n").addSpaces(lev);
|
||||
} else {
|
||||
to.add("{ messages_editChatAdmin");
|
||||
to.add("\n").addSpaces(lev);
|
||||
}
|
||||
switch (stage) {
|
||||
case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" user_id: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 2: to.add(" is_admin: "); ++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;
|
||||
}
|
||||
}
|
||||
|
||||
void _serialize_upload_saveFilePart(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) {
|
||||
if (stage) {
|
||||
to.add(",\n").addSpaces(lev);
|
||||
|
@ -5934,14 +6046,15 @@ void _serialize_messages_search(MTPStringLogger &to, int32 stage, int32 lev, Typ
|
|||
}
|
||||
switch (stage) {
|
||||
case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 2: to.add(" q: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 3: to.add(" filter: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 4: to.add(" min_date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 5: to.add(" max_date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 6: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 7: to.add(" max_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 8: to.add(" limit: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" important_only: "); ++stages.back(); if (flag & MTPmessages_search::flag_important_only) { to.add("NO [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break;
|
||||
case 2: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 3: to.add(" q: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 4: to.add(" filter: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 5: to.add(" min_date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 6: to.add(" max_date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 7: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 8: to.add(" max_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 9: to.add(" limit: "); ++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;
|
||||
}
|
||||
}
|
||||
|
@ -6111,12 +6224,13 @@ void _serialize_messages_sendMessage(MTPStringLogger &to, int32 stage, int32 lev
|
|||
}
|
||||
switch (stage) {
|
||||
case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 2: to.add(" reply_to_msg_id: "); ++stages.back(); if (flag & MTPmessages_sendMessage::flag_reply_to_msg_id) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break;
|
||||
case 3: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 4: to.add(" random_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 5: to.add(" reply_markup: "); ++stages.back(); if (flag & MTPmessages_sendMessage::flag_reply_markup) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break;
|
||||
case 6: to.add(" entities: "); ++stages.back(); if (flag & MTPmessages_sendMessage::flag_entities) { types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break;
|
||||
case 1: to.add(" no_webpage: "); ++stages.back(); if (flag & MTPmessages_sendMessage::flag_no_webpage) { to.add("NO [ BY BIT 1 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 1 IN FIELD flags ]"); } break;
|
||||
case 2: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 3: to.add(" reply_to_msg_id: "); ++stages.back(); if (flag & MTPmessages_sendMessage::flag_reply_to_msg_id) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break;
|
||||
case 4: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 5: to.add(" random_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 6: to.add(" reply_markup: "); ++stages.back(); if (flag & MTPmessages_sendMessage::flag_reply_markup) { types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 2 IN FIELD flags ]"); } break;
|
||||
case 7: to.add(" entities: "); ++stages.back(); if (flag & MTPmessages_sendMessage::flag_entities) { types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 3 IN FIELD flags ]"); } break;
|
||||
default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break;
|
||||
}
|
||||
}
|
||||
|
@ -6148,10 +6262,11 @@ void _serialize_messages_forwardMessages(MTPStringLogger &to, int32 stage, int32
|
|||
}
|
||||
switch (stage) {
|
||||
case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" from_peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 2: to.add(" id: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int); stages.push_back(0); flags.push_back(0); break;
|
||||
case 3: to.add(" random_id: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_long); stages.push_back(0); flags.push_back(0); break;
|
||||
case 4: to.add(" to_peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" broadcast: "); ++stages.back(); if (flag & MTPmessages_forwardMessages::flag_broadcast) { to.add("NO [ BY BIT 4 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 4 IN FIELD flags ]"); } break;
|
||||
case 2: to.add(" from_peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 3: to.add(" id: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_int); stages.push_back(0); flags.push_back(0); break;
|
||||
case 4: to.add(" random_id: "); ++stages.back(); types.push_back(0); vtypes.push_back(mtpc_long); stages.push_back(0); flags.push_back(0); break;
|
||||
case 5: to.add(" to_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;
|
||||
}
|
||||
}
|
||||
|
@ -6287,6 +6402,20 @@ void _serialize_messages_startBot(MTPStringLogger &to, int32 stage, int32 lev, T
|
|||
}
|
||||
}
|
||||
|
||||
void _serialize_messages_toggleChatAdmins(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) {
|
||||
if (stage) {
|
||||
to.add(",\n").addSpaces(lev);
|
||||
} else {
|
||||
to.add("{ messages_toggleChatAdmins");
|
||||
to.add("\n").addSpaces(lev);
|
||||
}
|
||||
switch (stage) {
|
||||
case 0: to.add(" chat_id: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" enabled: "); ++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;
|
||||
}
|
||||
}
|
||||
|
||||
void _serialize_channels_createChannel(MTPStringLogger &to, int32 stage, int32 lev, Types &types, Types &vtypes, StagesFlags &stages, StagesFlags &flags, const mtpPrime *start, const mtpPrime *end, int32 flag) {
|
||||
if (stage) {
|
||||
to.add(",\n").addSpaces(lev);
|
||||
|
@ -6296,9 +6425,10 @@ void _serialize_channels_createChannel(MTPStringLogger &to, int32 stage, int32 l
|
|||
}
|
||||
switch (stage) {
|
||||
case 0: to.add(" flags: "); ++stages.back(); if (start >= end) throw Exception("start >= end in flags"); else flags.back() = *start; types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 2: to.add(" about: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 3: to.add(" users: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 1: to.add(" broadcast: "); ++stages.back(); if (flag & MTPchannels_createChannel::flag_broadcast) { to.add("NO [ BY BIT 0 IN FIELD flags ]"); } else { to.add("[ SKIPPED BY BIT 0 IN FIELD flags ]"); } break;
|
||||
case 2: to.add(" title: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 3: to.add(" about: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break;
|
||||
case 4: to.add(" users: "); ++stages.back(); types.push_back(00); 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;
|
||||
}
|
||||
}
|
||||
|
@ -6934,6 +7064,9 @@ namespace {
|
|||
_serializers.insert(mtpc_destroy_session_none, _serialize_destroy_session_none);
|
||||
_serializers.insert(mtpc_new_session_created, _serialize_new_session_created);
|
||||
_serializers.insert(mtpc_http_wait, _serialize_http_wait);
|
||||
_serializers.insert(mtpc_boolFalse, _serialize_boolFalse);
|
||||
_serializers.insert(mtpc_boolTrue, _serialize_boolTrue);
|
||||
_serializers.insert(mtpc_true, _serialize_true);
|
||||
_serializers.insert(mtpc_error, _serialize_error);
|
||||
_serializers.insert(mtpc_null, _serialize_null);
|
||||
_serializers.insert(mtpc_inputPeerEmpty, _serialize_inputPeerEmpty);
|
||||
|
@ -7011,6 +7144,8 @@ namespace {
|
|||
_serializers.insert(mtpc_chatFull, _serialize_chatFull);
|
||||
_serializers.insert(mtpc_channelFull, _serialize_channelFull);
|
||||
_serializers.insert(mtpc_chatParticipant, _serialize_chatParticipant);
|
||||
_serializers.insert(mtpc_chatParticipantCreator, _serialize_chatParticipantCreator);
|
||||
_serializers.insert(mtpc_chatParticipantAdmin, _serialize_chatParticipantAdmin);
|
||||
_serializers.insert(mtpc_chatParticipantsForbidden, _serialize_chatParticipantsForbidden);
|
||||
_serializers.insert(mtpc_chatParticipants, _serialize_chatParticipants);
|
||||
_serializers.insert(mtpc_chatPhotoEmpty, _serialize_chatPhotoEmpty);
|
||||
|
@ -7331,6 +7466,7 @@ namespace {
|
|||
_serializers.insert(mtpc_messages_readEncryptedHistory, _serialize_messages_readEncryptedHistory);
|
||||
_serializers.insert(mtpc_messages_installStickerSet, _serialize_messages_installStickerSet);
|
||||
_serializers.insert(mtpc_messages_uninstallStickerSet, _serialize_messages_uninstallStickerSet);
|
||||
_serializers.insert(mtpc_messages_editChatAdmin, _serialize_messages_editChatAdmin);
|
||||
_serializers.insert(mtpc_upload_saveFilePart, _serialize_upload_saveFilePart);
|
||||
_serializers.insert(mtpc_upload_saveBigFilePart, _serialize_upload_saveBigFilePart);
|
||||
_serializers.insert(mtpc_help_saveAppLog, _serialize_help_saveAppLog);
|
||||
|
@ -7406,6 +7542,7 @@ namespace {
|
|||
_serializers.insert(mtpc_messages_sendBroadcast, _serialize_messages_sendBroadcast);
|
||||
_serializers.insert(mtpc_messages_importChatInvite, _serialize_messages_importChatInvite);
|
||||
_serializers.insert(mtpc_messages_startBot, _serialize_messages_startBot);
|
||||
_serializers.insert(mtpc_messages_toggleChatAdmins, _serialize_messages_toggleChatAdmins);
|
||||
_serializers.insert(mtpc_channels_createChannel, _serialize_channels_createChannel);
|
||||
_serializers.insert(mtpc_channels_editTitle, _serialize_channels_editTitle);
|
||||
_serializers.insert(mtpc_channels_editPhoto, _serialize_channels_editPhoto);
|
||||
|
|
|
@ -20,7 +20,7 @@ In addition, as a special exception, the copyright holders give permission
|
|||
to link the code of portions of this program with the OpenSSL library.
|
||||
|
||||
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
||||
Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
|
||||
Copyright (c) 2014 John Preston, https://desktop.telegram.org
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
|
@ -66,6 +66,9 @@ enum {
|
|||
mtpc_ping_delay_disconnect = 0xf3427b8c,
|
||||
mtpc_destroy_session = 0xe7512126,
|
||||
mtpc_register_saveDeveloperInfo = 0x9a5f6e95,
|
||||
mtpc_boolFalse = 0xbc799737,
|
||||
mtpc_boolTrue = 0x997275b5,
|
||||
mtpc_true = 0x3fedd339,
|
||||
mtpc_error = 0xc4b9f9bb,
|
||||
mtpc_null = 0x56730bcc,
|
||||
mtpc_inputPeerEmpty = 0x7f3b18ea,
|
||||
|
@ -143,6 +146,8 @@ enum {
|
|||
mtpc_chatFull = 0x2e02a614,
|
||||
mtpc_channelFull = 0xfab31aa3,
|
||||
mtpc_chatParticipant = 0xc8d7493e,
|
||||
mtpc_chatParticipantCreator = 0xda13538a,
|
||||
mtpc_chatParticipantAdmin = 0xe2d6e436,
|
||||
mtpc_chatParticipantsForbidden = 0xfc900c2b,
|
||||
mtpc_chatParticipants = 0x7841b415,
|
||||
mtpc_chatPhotoEmpty = 0x37c1011c,
|
||||
|
@ -529,6 +534,8 @@ enum {
|
|||
mtpc_messages_uninstallStickerSet = 0xf96e55de,
|
||||
mtpc_messages_startBot = 0x1b3e0ffc,
|
||||
mtpc_messages_getMessagesViews = 0xc4c8a55d,
|
||||
mtpc_messages_toggleChatAdmins = 0xec8bd9e1,
|
||||
mtpc_messages_editChatAdmin = 0xa9e69f2e,
|
||||
mtpc_updates_getState = 0xedd4882a,
|
||||
mtpc_updates_getDifference = 0xa041495,
|
||||
mtpc_updates_getChannelDifference = 0xbb32d7c0,
|
||||
|
@ -643,6 +650,10 @@ class MTPDnew_session_created;
|
|||
class MTPhttpWait;
|
||||
class MTPDhttp_wait;
|
||||
|
||||
class MTPbool;
|
||||
|
||||
class MTPtrue;
|
||||
|
||||
class MTPerror;
|
||||
class MTPDerror;
|
||||
|
||||
|
@ -739,6 +750,8 @@ class MTPDchannelFull;
|
|||
|
||||
class MTPchatParticipant;
|
||||
class MTPDchatParticipant;
|
||||
class MTPDchatParticipantCreator;
|
||||
class MTPDchatParticipantAdmin;
|
||||
|
||||
class MTPchatParticipants;
|
||||
class MTPDchatParticipantsForbidden;
|
||||
|
@ -1195,6 +1208,8 @@ typedef MTPBoxed<MTPpong> MTPPong;
|
|||
typedef MTPBoxed<MTPdestroySessionRes> MTPDestroySessionRes;
|
||||
typedef MTPBoxed<MTPnewSession> MTPNewSession;
|
||||
typedef MTPBoxed<MTPhttpWait> MTPHttpWait;
|
||||
typedef MTPBoxed<MTPbool> MTPBool;
|
||||
typedef MTPBoxed<MTPtrue> MTPTrue;
|
||||
typedef MTPBoxed<MTPerror> MTPError;
|
||||
typedef MTPBoxed<MTPnull> MTPNull;
|
||||
typedef MTPBoxed<MTPinputPeer> MTPInputPeer;
|
||||
|
@ -2103,6 +2118,52 @@ private:
|
|||
};
|
||||
typedef MTPBoxed<MTPhttpWait> MTPHttpWait;
|
||||
|
||||
class MTPbool {
|
||||
public:
|
||||
MTPbool() : _type(0) {
|
||||
}
|
||||
MTPbool(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) : _type(0) {
|
||||
read(from, end, cons);
|
||||
}
|
||||
|
||||
uint32 innerLength() const;
|
||||
mtpTypeId type() const;
|
||||
void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons);
|
||||
void write(mtpBuffer &to) const;
|
||||
|
||||
typedef void ResponseType;
|
||||
|
||||
private:
|
||||
explicit MTPbool(mtpTypeId type);
|
||||
|
||||
friend MTPbool MTP_boolFalse();
|
||||
friend MTPbool MTP_boolTrue();
|
||||
|
||||
mtpTypeId _type;
|
||||
};
|
||||
typedef MTPBoxed<MTPbool> MTPBool;
|
||||
|
||||
class MTPtrue {
|
||||
public:
|
||||
MTPtrue() {
|
||||
}
|
||||
MTPtrue(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_true) {
|
||||
read(from, end, cons);
|
||||
}
|
||||
|
||||
uint32 innerLength() const;
|
||||
mtpTypeId type() const;
|
||||
void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_true);
|
||||
void write(mtpBuffer &to) const;
|
||||
|
||||
typedef void ResponseType;
|
||||
|
||||
private:
|
||||
|
||||
friend MTPtrue MTP_true();
|
||||
};
|
||||
typedef MTPBoxed<MTPtrue> MTPTrue;
|
||||
|
||||
class MTPerror : private mtpDataOwner {
|
||||
public:
|
||||
MTPerror();
|
||||
|
@ -3316,32 +3377,66 @@ typedef MTPBoxed<MTPchatFull> MTPChatFull;
|
|||
|
||||
class MTPchatParticipant : private mtpDataOwner {
|
||||
public:
|
||||
MTPchatParticipant();
|
||||
MTPchatParticipant(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_chatParticipant) : mtpDataOwner(0) {
|
||||
MTPchatParticipant() : mtpDataOwner(0), _type(0) {
|
||||
}
|
||||
MTPchatParticipant(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) : mtpDataOwner(0), _type(0) {
|
||||
read(from, end, cons);
|
||||
}
|
||||
|
||||
MTPDchatParticipant &_chatParticipant() {
|
||||
if (!data) throw mtpErrorUninitialized();
|
||||
if (_type != mtpc_chatParticipant) throw mtpErrorWrongTypeId(_type, mtpc_chatParticipant);
|
||||
split();
|
||||
return *(MTPDchatParticipant*)data;
|
||||
}
|
||||
const MTPDchatParticipant &c_chatParticipant() const {
|
||||
if (!data) throw mtpErrorUninitialized();
|
||||
if (_type != mtpc_chatParticipant) throw mtpErrorWrongTypeId(_type, mtpc_chatParticipant);
|
||||
return *(const MTPDchatParticipant*)data;
|
||||
}
|
||||
|
||||
MTPDchatParticipantCreator &_chatParticipantCreator() {
|
||||
if (!data) throw mtpErrorUninitialized();
|
||||
if (_type != mtpc_chatParticipantCreator) throw mtpErrorWrongTypeId(_type, mtpc_chatParticipantCreator);
|
||||
split();
|
||||
return *(MTPDchatParticipantCreator*)data;
|
||||
}
|
||||
const MTPDchatParticipantCreator &c_chatParticipantCreator() const {
|
||||
if (!data) throw mtpErrorUninitialized();
|
||||
if (_type != mtpc_chatParticipantCreator) throw mtpErrorWrongTypeId(_type, mtpc_chatParticipantCreator);
|
||||
return *(const MTPDchatParticipantCreator*)data;
|
||||
}
|
||||
|
||||
MTPDchatParticipantAdmin &_chatParticipantAdmin() {
|
||||
if (!data) throw mtpErrorUninitialized();
|
||||
if (_type != mtpc_chatParticipantAdmin) throw mtpErrorWrongTypeId(_type, mtpc_chatParticipantAdmin);
|
||||
split();
|
||||
return *(MTPDchatParticipantAdmin*)data;
|
||||
}
|
||||
const MTPDchatParticipantAdmin &c_chatParticipantAdmin() const {
|
||||
if (!data) throw mtpErrorUninitialized();
|
||||
if (_type != mtpc_chatParticipantAdmin) throw mtpErrorWrongTypeId(_type, mtpc_chatParticipantAdmin);
|
||||
return *(const MTPDchatParticipantAdmin*)data;
|
||||
}
|
||||
|
||||
uint32 innerLength() const;
|
||||
mtpTypeId type() const;
|
||||
void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_chatParticipant);
|
||||
void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons);
|
||||
void write(mtpBuffer &to) const;
|
||||
|
||||
typedef void ResponseType;
|
||||
|
||||
private:
|
||||
explicit MTPchatParticipant(mtpTypeId type);
|
||||
explicit MTPchatParticipant(MTPDchatParticipant *_data);
|
||||
explicit MTPchatParticipant(MTPDchatParticipantCreator *_data);
|
||||
explicit MTPchatParticipant(MTPDchatParticipantAdmin *_data);
|
||||
|
||||
friend MTPchatParticipant MTP_chatParticipant(MTPint _user_id, MTPint _inviter_id, MTPint _date);
|
||||
friend MTPchatParticipant MTP_chatParticipantCreator(MTPint _user_id);
|
||||
friend MTPchatParticipant MTP_chatParticipantAdmin(MTPint _user_id, MTPint _inviter_id, MTPint _date);
|
||||
|
||||
mtpTypeId _type;
|
||||
};
|
||||
typedef MTPBoxed<MTPchatParticipant> MTPChatParticipant;
|
||||
|
||||
|
@ -9414,6 +9509,14 @@ public:
|
|||
MTPint vbot_info_version;
|
||||
|
||||
enum {
|
||||
flag_self = (1 << 10),
|
||||
flag_contact = (1 << 11),
|
||||
flag_mutual_contact = (1 << 12),
|
||||
flag_deleted = (1 << 13),
|
||||
flag_bot = (1 << 14),
|
||||
flag_bot_chat_history = (1 << 15),
|
||||
flag_bot_nochats = (1 << 16),
|
||||
flag_verified = (1 << 17),
|
||||
flag_access_hash = (1 << 0),
|
||||
flag_first_name = (1 << 1),
|
||||
flag_last_name = (1 << 2),
|
||||
|
@ -9424,6 +9527,14 @@ public:
|
|||
flag_bot_info_version = (1 << 14),
|
||||
};
|
||||
|
||||
bool is_self() const { return vflags.v & flag_self; }
|
||||
bool is_contact() const { return vflags.v & flag_contact; }
|
||||
bool is_mutual_contact() const { return vflags.v & flag_mutual_contact; }
|
||||
bool is_deleted() const { return vflags.v & flag_deleted; }
|
||||
bool is_bot() const { return vflags.v & flag_bot; }
|
||||
bool is_bot_chat_history() const { return vflags.v & flag_bot_chat_history; }
|
||||
bool is_bot_nochats() const { return vflags.v & flag_bot_nochats; }
|
||||
bool is_verified() const { return vflags.v & flag_verified; }
|
||||
bool has_access_hash() const { return vflags.v & flag_access_hash; }
|
||||
bool has_first_name() const { return vflags.v & flag_first_name; }
|
||||
bool has_last_name() const { return vflags.v & flag_last_name; }
|
||||
|
@ -9490,6 +9601,20 @@ public:
|
|||
MTPint vparticipants_count;
|
||||
MTPint vdate;
|
||||
MTPint vversion;
|
||||
|
||||
enum {
|
||||
flag_creator = (1 << 0),
|
||||
flag_kicked = (1 << 1),
|
||||
flag_left = (1 << 2),
|
||||
flag_has_admins = (1 << 3),
|
||||
flag_admin = (1 << 4),
|
||||
};
|
||||
|
||||
bool is_creator() const { return vflags.v & flag_creator; }
|
||||
bool is_kicked() const { return vflags.v & flag_kicked; }
|
||||
bool is_left() const { return vflags.v & flag_left; }
|
||||
bool is_has_admins() const { return vflags.v & flag_has_admins; }
|
||||
bool is_admin() const { return vflags.v & flag_admin; }
|
||||
};
|
||||
|
||||
class MTPDchatForbidden : public mtpDataImpl<MTPDchatForbidden> {
|
||||
|
@ -9520,9 +9645,23 @@ public:
|
|||
MTPint vversion;
|
||||
|
||||
enum {
|
||||
flag_creator = (1 << 0),
|
||||
flag_kicked = (1 << 1),
|
||||
flag_left = (1 << 2),
|
||||
flag_editor = (1 << 3),
|
||||
flag_moderator = (1 << 4),
|
||||
flag_broadcast = (1 << 5),
|
||||
flag_verified = (1 << 7),
|
||||
flag_username = (1 << 6),
|
||||
};
|
||||
|
||||
bool is_creator() const { return vflags.v & flag_creator; }
|
||||
bool is_kicked() const { return vflags.v & flag_kicked; }
|
||||
bool is_left() const { return vflags.v & flag_left; }
|
||||
bool is_editor() const { return vflags.v & flag_editor; }
|
||||
bool is_moderator() const { return vflags.v & flag_moderator; }
|
||||
bool is_broadcast() const { return vflags.v & flag_broadcast; }
|
||||
bool is_verified() const { return vflags.v & flag_verified; }
|
||||
bool has_username() const { return vflags.v & flag_username; }
|
||||
};
|
||||
|
||||
|
@ -9574,11 +9713,13 @@ public:
|
|||
MTPExportedChatInvite vexported_invite;
|
||||
|
||||
enum {
|
||||
flag_can_view_participants = (1 << 3),
|
||||
flag_participants_count = (1 << 0),
|
||||
flag_admins_count = (1 << 1),
|
||||
flag_kicked_count = (1 << 2),
|
||||
};
|
||||
|
||||
bool is_can_view_participants() const { return vflags.v & flag_can_view_participants; }
|
||||
bool has_participants_count() const { return vflags.v & flag_participants_count; }
|
||||
bool has_admins_count() const { return vflags.v & flag_admins_count; }
|
||||
bool has_kicked_count() const { return vflags.v & flag_kicked_count; }
|
||||
|
@ -9596,6 +9737,28 @@ public:
|
|||
MTPint vdate;
|
||||
};
|
||||
|
||||
class MTPDchatParticipantCreator : public mtpDataImpl<MTPDchatParticipantCreator> {
|
||||
public:
|
||||
MTPDchatParticipantCreator() {
|
||||
}
|
||||
MTPDchatParticipantCreator(MTPint _user_id) : vuser_id(_user_id) {
|
||||
}
|
||||
|
||||
MTPint vuser_id;
|
||||
};
|
||||
|
||||
class MTPDchatParticipantAdmin : public mtpDataImpl<MTPDchatParticipantAdmin> {
|
||||
public:
|
||||
MTPDchatParticipantAdmin() {
|
||||
}
|
||||
MTPDchatParticipantAdmin(MTPint _user_id, MTPint _inviter_id, MTPint _date) : vuser_id(_user_id), vinviter_id(_inviter_id), vdate(_date) {
|
||||
}
|
||||
|
||||
MTPint vuser_id;
|
||||
MTPint vinviter_id;
|
||||
MTPint vdate;
|
||||
};
|
||||
|
||||
class MTPDchatParticipantsForbidden : public mtpDataImpl<MTPDchatParticipantsForbidden> {
|
||||
public:
|
||||
MTPDchatParticipantsForbidden() {
|
||||
|
@ -9670,6 +9833,10 @@ public:
|
|||
MTPint vviews;
|
||||
|
||||
enum {
|
||||
flag_unread = (1 << 0),
|
||||
flag_out = (1 << 1),
|
||||
flag_mentioned = (1 << 4),
|
||||
flag_media_unread = (1 << 5),
|
||||
flag_from_id = (1 << 8),
|
||||
flag_fwd_from_id = (1 << 2),
|
||||
flag_fwd_date = (1 << 2),
|
||||
|
@ -9680,6 +9847,10 @@ public:
|
|||
flag_views = (1 << 10),
|
||||
};
|
||||
|
||||
bool is_unread() const { return vflags.v & flag_unread; }
|
||||
bool is_out() const { return vflags.v & flag_out; }
|
||||
bool is_mentioned() const { return vflags.v & flag_mentioned; }
|
||||
bool is_media_unread() const { return vflags.v & flag_media_unread; }
|
||||
bool has_from_id() const { return vflags.v & flag_from_id; }
|
||||
bool has_fwd_from_id() const { return vflags.v & flag_fwd_from_id; }
|
||||
bool has_fwd_date() const { return vflags.v & flag_fwd_date; }
|
||||
|
@ -9705,9 +9876,17 @@ public:
|
|||
MTPMessageAction vaction;
|
||||
|
||||
enum {
|
||||
flag_unread = (1 << 0),
|
||||
flag_out = (1 << 1),
|
||||
flag_mentioned = (1 << 4),
|
||||
flag_media_unread = (1 << 5),
|
||||
flag_from_id = (1 << 8),
|
||||
};
|
||||
|
||||
bool is_unread() const { return vflags.v & flag_unread; }
|
||||
bool is_out() const { return vflags.v & flag_out; }
|
||||
bool is_mentioned() const { return vflags.v & flag_mentioned; }
|
||||
bool is_media_unread() const { return vflags.v & flag_media_unread; }
|
||||
bool has_from_id() const { return vflags.v & flag_from_id; }
|
||||
};
|
||||
|
||||
|
@ -10851,12 +11030,20 @@ public:
|
|||
MTPVector<MTPMessageEntity> ventities;
|
||||
|
||||
enum {
|
||||
flag_unread = (1 << 0),
|
||||
flag_out = (1 << 1),
|
||||
flag_mentioned = (1 << 4),
|
||||
flag_media_unread = (1 << 5),
|
||||
flag_fwd_from_id = (1 << 2),
|
||||
flag_fwd_date = (1 << 2),
|
||||
flag_reply_to_msg_id = (1 << 3),
|
||||
flag_entities = (1 << 7),
|
||||
};
|
||||
|
||||
bool is_unread() const { return vflags.v & flag_unread; }
|
||||
bool is_out() const { return vflags.v & flag_out; }
|
||||
bool is_mentioned() const { return vflags.v & flag_mentioned; }
|
||||
bool is_media_unread() const { return vflags.v & flag_media_unread; }
|
||||
bool has_fwd_from_id() const { return vflags.v & flag_fwd_from_id; }
|
||||
bool has_fwd_date() const { return vflags.v & flag_fwd_date; }
|
||||
bool has_reply_to_msg_id() const { return vflags.v & flag_reply_to_msg_id; }
|
||||
|
@ -10884,12 +11071,20 @@ public:
|
|||
MTPVector<MTPMessageEntity> ventities;
|
||||
|
||||
enum {
|
||||
flag_unread = (1 << 0),
|
||||
flag_out = (1 << 1),
|
||||
flag_mentioned = (1 << 4),
|
||||
flag_media_unread = (1 << 5),
|
||||
flag_fwd_from_id = (1 << 2),
|
||||
flag_fwd_date = (1 << 2),
|
||||
flag_reply_to_msg_id = (1 << 3),
|
||||
flag_entities = (1 << 7),
|
||||
};
|
||||
|
||||
bool is_unread() const { return vflags.v & flag_unread; }
|
||||
bool is_out() const { return vflags.v & flag_out; }
|
||||
bool is_mentioned() const { return vflags.v & flag_mentioned; }
|
||||
bool is_media_unread() const { return vflags.v & flag_media_unread; }
|
||||
bool has_fwd_from_id() const { return vflags.v & flag_fwd_from_id; }
|
||||
bool has_fwd_date() const { return vflags.v & flag_fwd_date; }
|
||||
bool has_reply_to_msg_id() const { return vflags.v & flag_reply_to_msg_id; }
|
||||
|
@ -10952,10 +11147,14 @@ public:
|
|||
MTPVector<MTPMessageEntity> ventities;
|
||||
|
||||
enum {
|
||||
flag_unread = (1 << 0),
|
||||
flag_out = (1 << 1),
|
||||
flag_media = (1 << 9),
|
||||
flag_entities = (1 << 7),
|
||||
};
|
||||
|
||||
bool is_unread() const { return vflags.v & flag_unread; }
|
||||
bool is_out() const { return vflags.v & flag_out; }
|
||||
bool has_media() const { return vflags.v & flag_media; }
|
||||
bool has_entities() const { return vflags.v & flag_entities; }
|
||||
};
|
||||
|
@ -11017,6 +11216,14 @@ public:
|
|||
MTPint vid;
|
||||
MTPstring vip_address;
|
||||
MTPint vport;
|
||||
|
||||
enum {
|
||||
flag_ipv6 = (1 << 0),
|
||||
flag_media_only = (1 << 1),
|
||||
};
|
||||
|
||||
bool is_ipv6() const { return vflags.v & flag_ipv6; }
|
||||
bool is_media_only() const { return vflags.v & flag_media_only; }
|
||||
};
|
||||
|
||||
class MTPDconfig : public mtpDataImpl<MTPDconfig> {
|
||||
|
@ -11826,6 +12033,16 @@ public:
|
|||
|
||||
MTPint vflags;
|
||||
MTPstring vtitle;
|
||||
|
||||
enum {
|
||||
flag_channel = (1 << 0),
|
||||
flag_broadcast = (1 << 1),
|
||||
flag_public = (1 << 2),
|
||||
};
|
||||
|
||||
bool is_channel() const { return vflags.v & flag_channel; }
|
||||
bool is_broadcast() const { return vflags.v & flag_broadcast; }
|
||||
bool is_public() const { return vflags.v & flag_public; }
|
||||
};
|
||||
|
||||
class MTPDinputStickerSetID : public mtpDataImpl<MTPDinputStickerSetID> {
|
||||
|
@ -11863,6 +12080,16 @@ public:
|
|||
MTPstring vshort_name;
|
||||
MTPint vcount;
|
||||
MTPint vhash;
|
||||
|
||||
enum {
|
||||
flag_installed = (1 << 0),
|
||||
flag_disabled = (1 << 1),
|
||||
flag_official = (1 << 2),
|
||||
};
|
||||
|
||||
bool is_installed() const { return vflags.v & flag_installed; }
|
||||
bool is_disabled() const { return vflags.v & flag_disabled; }
|
||||
bool is_official() const { return vflags.v & flag_official; }
|
||||
};
|
||||
|
||||
class MTPDmessages_stickerSet : public mtpDataImpl<MTPDmessages_stickerSet> {
|
||||
|
@ -11930,6 +12157,12 @@ public:
|
|||
}
|
||||
|
||||
MTPint vflags;
|
||||
|
||||
enum {
|
||||
flag_selective = (1 << 2),
|
||||
};
|
||||
|
||||
bool is_selective() const { return vflags.v & flag_selective; }
|
||||
};
|
||||
|
||||
class MTPDreplyKeyboardForceReply : public mtpDataImpl<MTPDreplyKeyboardForceReply> {
|
||||
|
@ -11940,6 +12173,14 @@ public:
|
|||
}
|
||||
|
||||
MTPint vflags;
|
||||
|
||||
enum {
|
||||
flag_single_use = (1 << 1),
|
||||
flag_selective = (1 << 2),
|
||||
};
|
||||
|
||||
bool is_single_use() const { return vflags.v & flag_single_use; }
|
||||
bool is_selective() const { return vflags.v & flag_selective; }
|
||||
};
|
||||
|
||||
class MTPDreplyKeyboardMarkup : public mtpDataImpl<MTPDreplyKeyboardMarkup> {
|
||||
|
@ -11951,6 +12192,16 @@ public:
|
|||
|
||||
MTPint vflags;
|
||||
MTPVector<MTPKeyboardButtonRow> vrows;
|
||||
|
||||
enum {
|
||||
flag_resize = (1 << 0),
|
||||
flag_single_use = (1 << 1),
|
||||
flag_selective = (1 << 2),
|
||||
};
|
||||
|
||||
bool is_resize() const { return vflags.v & flag_resize; }
|
||||
bool is_single_use() const { return vflags.v & flag_single_use; }
|
||||
bool is_selective() const { return vflags.v & flag_selective; }
|
||||
};
|
||||
|
||||
class MTPDhelp_appChangelog : public mtpDataImpl<MTPDhelp_appChangelog> {
|
||||
|
@ -12145,9 +12396,11 @@ public:
|
|||
MTPint vtimeout;
|
||||
|
||||
enum {
|
||||
flag_final = (1 << 0),
|
||||
flag_timeout = (1 << 1),
|
||||
};
|
||||
|
||||
bool is_final() const { return vflags.v & flag_final; }
|
||||
bool has_timeout() const { return vflags.v & flag_timeout; }
|
||||
};
|
||||
|
||||
|
@ -12171,9 +12424,11 @@ public:
|
|||
MTPVector<MTPUser> vusers;
|
||||
|
||||
enum {
|
||||
flag_final = (1 << 0),
|
||||
flag_timeout = (1 << 1),
|
||||
};
|
||||
|
||||
bool is_final() const { return vflags.v & flag_final; }
|
||||
bool has_timeout() const { return vflags.v & flag_timeout; }
|
||||
};
|
||||
|
||||
|
@ -12193,9 +12448,11 @@ public:
|
|||
MTPVector<MTPUser> vusers;
|
||||
|
||||
enum {
|
||||
flag_final = (1 << 0),
|
||||
flag_timeout = (1 << 1),
|
||||
};
|
||||
|
||||
bool is_final() const { return vflags.v & flag_final; }
|
||||
bool has_timeout() const { return vflags.v & flag_timeout; }
|
||||
};
|
||||
|
||||
|
@ -12208,6 +12465,12 @@ public:
|
|||
|
||||
MTPint vflags;
|
||||
MTPVector<MTPMessageRange> vranges;
|
||||
|
||||
enum {
|
||||
flag_important_only = (1 << 0),
|
||||
};
|
||||
|
||||
bool is_important_only() const { return vflags.v & flag_important_only; }
|
||||
};
|
||||
|
||||
class MTPDchannelParticipant : public mtpDataImpl<MTPDchannelParticipant> {
|
||||
|
@ -15199,6 +15462,12 @@ public:
|
|||
MTPmessages_search(MTPint _flags, const MTPInputPeer &_peer, const MTPstring &_q, const MTPMessagesFilter &_filter, MTPint _min_date, MTPint _max_date, MTPint _offset, MTPint _max_id, MTPint _limit) : vflags(_flags), vpeer(_peer), vq(_q), vfilter(_filter), vmin_date(_min_date), vmax_date(_max_date), voffset(_offset), vmax_id(_max_id), vlimit(_limit) {
|
||||
}
|
||||
|
||||
enum {
|
||||
flag_important_only = (1 << 0),
|
||||
};
|
||||
|
||||
bool is_important_only() const { return vflags.v & flag_important_only; }
|
||||
|
||||
uint32 innerLength() const {
|
||||
return vflags.innerLength() + vpeer.innerLength() + vq.innerLength() + vfilter.innerLength() + vmin_date.innerLength() + vmax_date.innerLength() + voffset.innerLength() + vmax_id.innerLength() + vlimit.innerLength();
|
||||
}
|
||||
|
@ -15468,11 +15737,13 @@ public:
|
|||
}
|
||||
|
||||
enum {
|
||||
flag_no_webpage = (1 << 1),
|
||||
flag_reply_to_msg_id = (1 << 0),
|
||||
flag_reply_markup = (1 << 2),
|
||||
flag_entities = (1 << 3),
|
||||
};
|
||||
|
||||
bool is_no_webpage() const { return vflags.v & flag_no_webpage; }
|
||||
bool has_reply_to_msg_id() const { return vflags.v & flag_reply_to_msg_id; }
|
||||
bool has_reply_markup() const { return vflags.v & flag_reply_markup; }
|
||||
bool has_entities() const { return vflags.v & flag_entities; }
|
||||
|
@ -15594,6 +15865,12 @@ public:
|
|||
MTPmessages_forwardMessages(MTPint _flags, const MTPInputPeer &_from_peer, const MTPVector<MTPint> &_id, const MTPVector<MTPlong> &_random_id, const MTPInputPeer &_to_peer) : vflags(_flags), vfrom_peer(_from_peer), vid(_id), vrandom_id(_random_id), vto_peer(_to_peer) {
|
||||
}
|
||||
|
||||
enum {
|
||||
flag_broadcast = (1 << 4),
|
||||
};
|
||||
|
||||
bool is_broadcast() const { return vflags.v & flag_broadcast; }
|
||||
|
||||
uint32 innerLength() const {
|
||||
return vflags.innerLength() + vfrom_peer.innerLength() + vid.innerLength() + vrandom_id.innerLength() + vto_peer.innerLength();
|
||||
}
|
||||
|
@ -16973,6 +17250,93 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
class MTPmessages_toggleChatAdmins { // RPC method 'messages.toggleChatAdmins'
|
||||
public:
|
||||
MTPint vchat_id;
|
||||
MTPBool venabled;
|
||||
|
||||
MTPmessages_toggleChatAdmins() {
|
||||
}
|
||||
MTPmessages_toggleChatAdmins(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_toggleChatAdmins) {
|
||||
read(from, end, cons);
|
||||
}
|
||||
MTPmessages_toggleChatAdmins(MTPint _chat_id, MTPBool _enabled) : vchat_id(_chat_id), venabled(_enabled) {
|
||||
}
|
||||
|
||||
uint32 innerLength() const {
|
||||
return vchat_id.innerLength() + venabled.innerLength();
|
||||
}
|
||||
mtpTypeId type() const {
|
||||
return mtpc_messages_toggleChatAdmins;
|
||||
}
|
||||
void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_toggleChatAdmins) {
|
||||
vchat_id.read(from, end);
|
||||
venabled.read(from, end);
|
||||
}
|
||||
void write(mtpBuffer &to) const {
|
||||
vchat_id.write(to);
|
||||
venabled.write(to);
|
||||
}
|
||||
|
||||
typedef MTPUpdates ResponseType;
|
||||
};
|
||||
class MTPmessages_ToggleChatAdmins : public MTPBoxed<MTPmessages_toggleChatAdmins> {
|
||||
public:
|
||||
MTPmessages_ToggleChatAdmins() {
|
||||
}
|
||||
MTPmessages_ToggleChatAdmins(const MTPmessages_toggleChatAdmins &v) : MTPBoxed<MTPmessages_toggleChatAdmins>(v) {
|
||||
}
|
||||
MTPmessages_ToggleChatAdmins(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed<MTPmessages_toggleChatAdmins>(from, end, cons) {
|
||||
}
|
||||
MTPmessages_ToggleChatAdmins(MTPint _chat_id, MTPBool _enabled) : MTPBoxed<MTPmessages_toggleChatAdmins>(MTPmessages_toggleChatAdmins(_chat_id, _enabled)) {
|
||||
}
|
||||
};
|
||||
|
||||
class MTPmessages_editChatAdmin { // RPC method 'messages.editChatAdmin'
|
||||
public:
|
||||
MTPint vchat_id;
|
||||
MTPInputUser vuser_id;
|
||||
MTPBool vis_admin;
|
||||
|
||||
MTPmessages_editChatAdmin() {
|
||||
}
|
||||
MTPmessages_editChatAdmin(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_editChatAdmin) {
|
||||
read(from, end, cons);
|
||||
}
|
||||
MTPmessages_editChatAdmin(MTPint _chat_id, const MTPInputUser &_user_id, MTPBool _is_admin) : vchat_id(_chat_id), vuser_id(_user_id), vis_admin(_is_admin) {
|
||||
}
|
||||
|
||||
uint32 innerLength() const {
|
||||
return vchat_id.innerLength() + vuser_id.innerLength() + vis_admin.innerLength();
|
||||
}
|
||||
mtpTypeId type() const {
|
||||
return mtpc_messages_editChatAdmin;
|
||||
}
|
||||
void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_messages_editChatAdmin) {
|
||||
vchat_id.read(from, end);
|
||||
vuser_id.read(from, end);
|
||||
vis_admin.read(from, end);
|
||||
}
|
||||
void write(mtpBuffer &to) const {
|
||||
vchat_id.write(to);
|
||||
vuser_id.write(to);
|
||||
vis_admin.write(to);
|
||||
}
|
||||
|
||||
typedef MTPBool ResponseType;
|
||||
};
|
||||
class MTPmessages_EditChatAdmin : public MTPBoxed<MTPmessages_editChatAdmin> {
|
||||
public:
|
||||
MTPmessages_EditChatAdmin() {
|
||||
}
|
||||
MTPmessages_EditChatAdmin(const MTPmessages_editChatAdmin &v) : MTPBoxed<MTPmessages_editChatAdmin>(v) {
|
||||
}
|
||||
MTPmessages_EditChatAdmin(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed<MTPmessages_editChatAdmin>(from, end, cons) {
|
||||
}
|
||||
MTPmessages_EditChatAdmin(MTPint _chat_id, const MTPInputUser &_user_id, MTPBool _is_admin) : MTPBoxed<MTPmessages_editChatAdmin>(MTPmessages_editChatAdmin(_chat_id, _user_id, _is_admin)) {
|
||||
}
|
||||
};
|
||||
|
||||
class MTPupdates_getState { // RPC method 'updates.getState'
|
||||
public:
|
||||
MTPupdates_getState() {
|
||||
|
@ -18171,6 +18535,12 @@ public:
|
|||
MTPchannels_createChannel(MTPint _flags, const MTPstring &_title, const MTPstring &_about, const MTPVector<MTPInputUser> &_users) : vflags(_flags), vtitle(_title), vabout(_about), vusers(_users) {
|
||||
}
|
||||
|
||||
enum {
|
||||
flag_broadcast = (1 << 0),
|
||||
};
|
||||
|
||||
bool is_broadcast() const { return vflags.v & flag_broadcast; }
|
||||
|
||||
uint32 innerLength() const {
|
||||
return vflags.innerLength() + vtitle.innerLength() + vabout.innerLength() + vusers.innerLength();
|
||||
}
|
||||
|
@ -19639,6 +20009,52 @@ inline MTPhttpWait MTP_http_wait(MTPint _max_delay, MTPint _wait_after, MTPint _
|
|||
return MTPhttpWait(new MTPDhttp_wait(_max_delay, _wait_after, _max_wait));
|
||||
}
|
||||
|
||||
inline uint32 MTPbool::innerLength() const {
|
||||
return 0;
|
||||
}
|
||||
inline mtpTypeId MTPbool::type() const {
|
||||
if (!_type) throw mtpErrorUninitialized();
|
||||
return _type;
|
||||
}
|
||||
inline void MTPbool::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) {
|
||||
switch (cons) {
|
||||
case mtpc_boolFalse: _type = cons; break;
|
||||
case mtpc_boolTrue: _type = cons; break;
|
||||
default: throw mtpErrorUnexpected(cons, "MTPbool");
|
||||
}
|
||||
}
|
||||
inline void MTPbool::write(mtpBuffer &to) const {
|
||||
switch (_type) {
|
||||
}
|
||||
}
|
||||
inline MTPbool::MTPbool(mtpTypeId type) : _type(type) {
|
||||
switch (type) {
|
||||
case mtpc_boolFalse: break;
|
||||
case mtpc_boolTrue: break;
|
||||
default: throw mtpErrorBadTypeId(type, "MTPbool");
|
||||
}
|
||||
}
|
||||
inline MTPbool MTP_boolFalse() {
|
||||
return MTPbool(mtpc_boolFalse);
|
||||
}
|
||||
inline MTPbool MTP_boolTrue() {
|
||||
return MTPbool(mtpc_boolTrue);
|
||||
}
|
||||
|
||||
inline uint32 MTPtrue::innerLength() const {
|
||||
return 0;
|
||||
}
|
||||
inline mtpTypeId MTPtrue::type() const {
|
||||
return mtpc_true;
|
||||
}
|
||||
inline void MTPtrue::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) {
|
||||
}
|
||||
inline void MTPtrue::write(mtpBuffer &to) const {
|
||||
}
|
||||
inline MTPtrue MTP_true() {
|
||||
return MTPtrue();
|
||||
}
|
||||
|
||||
inline MTPerror::MTPerror() : mtpDataOwner(new MTPDerror()) {
|
||||
}
|
||||
|
||||
|
@ -21405,36 +21821,95 @@ inline MTPchatFull MTP_channelFull(MTPint _flags, MTPint _id, const MTPstring &_
|
|||
return MTPchatFull(new MTPDchannelFull(_flags, _id, _about, _participants_count, _admins_count, _kicked_count, _read_inbox_max_id, _unread_count, _unread_important_count, _chat_photo, _notify_settings, _exported_invite));
|
||||
}
|
||||
|
||||
inline MTPchatParticipant::MTPchatParticipant() : mtpDataOwner(new MTPDchatParticipant()) {
|
||||
}
|
||||
|
||||
inline uint32 MTPchatParticipant::innerLength() const {
|
||||
const MTPDchatParticipant &v(c_chatParticipant());
|
||||
return v.vuser_id.innerLength() + v.vinviter_id.innerLength() + v.vdate.innerLength();
|
||||
switch (_type) {
|
||||
case mtpc_chatParticipant: {
|
||||
const MTPDchatParticipant &v(c_chatParticipant());
|
||||
return v.vuser_id.innerLength() + v.vinviter_id.innerLength() + v.vdate.innerLength();
|
||||
}
|
||||
case mtpc_chatParticipantCreator: {
|
||||
const MTPDchatParticipantCreator &v(c_chatParticipantCreator());
|
||||
return v.vuser_id.innerLength();
|
||||
}
|
||||
case mtpc_chatParticipantAdmin: {
|
||||
const MTPDchatParticipantAdmin &v(c_chatParticipantAdmin());
|
||||
return v.vuser_id.innerLength() + v.vinviter_id.innerLength() + v.vdate.innerLength();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
inline mtpTypeId MTPchatParticipant::type() const {
|
||||
return mtpc_chatParticipant;
|
||||
if (!_type) throw mtpErrorUninitialized();
|
||||
return _type;
|
||||
}
|
||||
inline void MTPchatParticipant::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) {
|
||||
if (cons != mtpc_chatParticipant) throw mtpErrorUnexpected(cons, "MTPchatParticipant");
|
||||
|
||||
if (!data) setData(new MTPDchatParticipant());
|
||||
MTPDchatParticipant &v(_chatParticipant());
|
||||
v.vuser_id.read(from, end);
|
||||
v.vinviter_id.read(from, end);
|
||||
v.vdate.read(from, end);
|
||||
if (cons != _type) setData(0);
|
||||
switch (cons) {
|
||||
case mtpc_chatParticipant: _type = cons; {
|
||||
if (!data) setData(new MTPDchatParticipant());
|
||||
MTPDchatParticipant &v(_chatParticipant());
|
||||
v.vuser_id.read(from, end);
|
||||
v.vinviter_id.read(from, end);
|
||||
v.vdate.read(from, end);
|
||||
} break;
|
||||
case mtpc_chatParticipantCreator: _type = cons; {
|
||||
if (!data) setData(new MTPDchatParticipantCreator());
|
||||
MTPDchatParticipantCreator &v(_chatParticipantCreator());
|
||||
v.vuser_id.read(from, end);
|
||||
} break;
|
||||
case mtpc_chatParticipantAdmin: _type = cons; {
|
||||
if (!data) setData(new MTPDchatParticipantAdmin());
|
||||
MTPDchatParticipantAdmin &v(_chatParticipantAdmin());
|
||||
v.vuser_id.read(from, end);
|
||||
v.vinviter_id.read(from, end);
|
||||
v.vdate.read(from, end);
|
||||
} break;
|
||||
default: throw mtpErrorUnexpected(cons, "MTPchatParticipant");
|
||||
}
|
||||
}
|
||||
inline void MTPchatParticipant::write(mtpBuffer &to) const {
|
||||
const MTPDchatParticipant &v(c_chatParticipant());
|
||||
v.vuser_id.write(to);
|
||||
v.vinviter_id.write(to);
|
||||
v.vdate.write(to);
|
||||
switch (_type) {
|
||||
case mtpc_chatParticipant: {
|
||||
const MTPDchatParticipant &v(c_chatParticipant());
|
||||
v.vuser_id.write(to);
|
||||
v.vinviter_id.write(to);
|
||||
v.vdate.write(to);
|
||||
} break;
|
||||
case mtpc_chatParticipantCreator: {
|
||||
const MTPDchatParticipantCreator &v(c_chatParticipantCreator());
|
||||
v.vuser_id.write(to);
|
||||
} break;
|
||||
case mtpc_chatParticipantAdmin: {
|
||||
const MTPDchatParticipantAdmin &v(c_chatParticipantAdmin());
|
||||
v.vuser_id.write(to);
|
||||
v.vinviter_id.write(to);
|
||||
v.vdate.write(to);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
inline MTPchatParticipant::MTPchatParticipant(MTPDchatParticipant *_data) : mtpDataOwner(_data) {
|
||||
inline MTPchatParticipant::MTPchatParticipant(mtpTypeId type) : mtpDataOwner(0), _type(type) {
|
||||
switch (type) {
|
||||
case mtpc_chatParticipant: setData(new MTPDchatParticipant()); break;
|
||||
case mtpc_chatParticipantCreator: setData(new MTPDchatParticipantCreator()); break;
|
||||
case mtpc_chatParticipantAdmin: setData(new MTPDchatParticipantAdmin()); break;
|
||||
default: throw mtpErrorBadTypeId(type, "MTPchatParticipant");
|
||||
}
|
||||
}
|
||||
inline MTPchatParticipant::MTPchatParticipant(MTPDchatParticipant *_data) : mtpDataOwner(_data), _type(mtpc_chatParticipant) {
|
||||
}
|
||||
inline MTPchatParticipant::MTPchatParticipant(MTPDchatParticipantCreator *_data) : mtpDataOwner(_data), _type(mtpc_chatParticipantCreator) {
|
||||
}
|
||||
inline MTPchatParticipant::MTPchatParticipant(MTPDchatParticipantAdmin *_data) : mtpDataOwner(_data), _type(mtpc_chatParticipantAdmin) {
|
||||
}
|
||||
inline MTPchatParticipant MTP_chatParticipant(MTPint _user_id, MTPint _inviter_id, MTPint _date) {
|
||||
return MTPchatParticipant(new MTPDchatParticipant(_user_id, _inviter_id, _date));
|
||||
}
|
||||
inline MTPchatParticipant MTP_chatParticipantCreator(MTPint _user_id) {
|
||||
return MTPchatParticipant(new MTPDchatParticipantCreator(_user_id));
|
||||
}
|
||||
inline MTPchatParticipant MTP_chatParticipantAdmin(MTPint _user_id, MTPint _inviter_id, MTPint _date) {
|
||||
return MTPchatParticipant(new MTPDchatParticipantAdmin(_user_id, _inviter_id, _date));
|
||||
}
|
||||
|
||||
inline uint32 MTPchatParticipants::innerLength() const {
|
||||
switch (_type) {
|
||||
|
|
|
@ -125,6 +125,12 @@ register.saveDeveloperInfo#9a5f6e95 name:string email:string phone_number:string
|
|||
///////////////////////////////
|
||||
|
||||
---types---
|
||||
boolFalse#bc799737 = Bool;
|
||||
boolTrue#997275b5 = Bool;
|
||||
|
||||
true#3fedd339 = True;
|
||||
|
||||
vector#1cb5c415 {t:Type} # [ t ] = Vector t;
|
||||
|
||||
error#c4b9f9bb code:int text:string = Error;
|
||||
|
||||
|
@ -203,7 +209,7 @@ fileLocationUnavailable#7c596b46 volume_id:long local_id:int secret:long = FileL
|
|||
fileLocation#53d69076 dc_id:int volume_id:long local_id:int secret:long = FileLocation;
|
||||
|
||||
userEmpty#200250ba id:int = User;
|
||||
user#22e49072 flags:# id:int access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int = User;
|
||||
user#22e49072 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true id:int access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int = User;
|
||||
|
||||
userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;
|
||||
userProfilePhoto#d559d8c8 photo_id:long photo_small:FileLocation photo_big:FileLocation = UserProfilePhoto;
|
||||
|
@ -216,15 +222,17 @@ userStatusLastWeek#7bf09fc = UserStatus;
|
|||
userStatusLastMonth#77ebc742 = UserStatus;
|
||||
|
||||
chatEmpty#9ba2d800 id:int = Chat;
|
||||
chat#7312bc48 flags:# id:int title:string photo:ChatPhoto participants_count:int date:int version:int = Chat;
|
||||
chat#7312bc48 flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true has_admins:flags.3?true admin:flags.4?true id:int title:string photo:ChatPhoto participants_count:int date:int version:int = Chat;
|
||||
chatForbidden#7328bdb id:int title:string = Chat;
|
||||
channel#678e9587 flags:# id:int access_hash:long title:string username:flags.6?string photo:ChatPhoto date:int version:int = Chat;
|
||||
channel#678e9587 flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true editor:flags.3?true moderator:flags.4?true broadcast:flags.5?true verified:flags.7?true id:int access_hash:long title:string username:flags.6?string photo:ChatPhoto date:int version:int = Chat;
|
||||
channelForbidden#2d85832c id:int access_hash:long title:string = Chat;
|
||||
|
||||
chatFull#2e02a614 id:int participants:ChatParticipants chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite bot_info:Vector<BotInfo> = ChatFull;
|
||||
channelFull#fab31aa3 flags:# id:int about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int read_inbox_max_id:int unread_count:int unread_important_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite = ChatFull;
|
||||
channelFull#fab31aa3 flags:# can_view_participants:flags.3?true id:int about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int read_inbox_max_id:int unread_count:int unread_important_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:ExportedChatInvite = ChatFull;
|
||||
|
||||
chatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant;
|
||||
chatParticipantCreator#da13538a user_id:int = ChatParticipant;
|
||||
chatParticipantAdmin#e2d6e436 user_id:int inviter_id:int date:int = ChatParticipant;
|
||||
|
||||
chatParticipantsForbidden#fc900c2b flags:# chat_id:int self_participant:flags.0?ChatParticipant = ChatParticipants;
|
||||
chatParticipants#7841b415 chat_id:int admin_id:int participants:Vector<ChatParticipant> version:int = ChatParticipants;
|
||||
|
@ -233,8 +241,8 @@ chatPhotoEmpty#37c1011c = ChatPhoto;
|
|||
chatPhoto#6153276a photo_small:FileLocation photo_big:FileLocation = ChatPhoto;
|
||||
|
||||
messageEmpty#83e5de54 id:int = Message;
|
||||
message#5ba66c13 flags:# id:int from_id:flags.8?int to_id:Peer fwd_from_id:flags.2?Peer fwd_date:flags.2?int reply_to_msg_id:flags.3?int date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int = Message;
|
||||
messageService#c06b9607 flags:# id:int from_id:flags.8?int to_id:Peer date:int action:MessageAction = Message;
|
||||
message#5ba66c13 flags:# unread:flags.0?true out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true id:int from_id:flags.8?int to_id:Peer fwd_from_id:flags.2?Peer fwd_date:flags.2?int reply_to_msg_id:flags.3?int date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int = Message;
|
||||
messageService#c06b9607 flags:# unread:flags.0?true out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true id:int from_id:flags.8?int to_id:Peer date:int action:MessageAction = Message;
|
||||
|
||||
messageMediaEmpty#3ded6320 = MessageMedia;
|
||||
messageMediaPhoto#3d8ce53d photo:Photo caption:string = MessageMedia;
|
||||
|
@ -391,12 +399,12 @@ updates.difference#f49ca0 new_messages:Vector<Message> new_encrypted_messages:Ve
|
|||
updates.differenceSlice#a8fb1981 new_messages:Vector<Message> new_encrypted_messages:Vector<EncryptedMessage> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> intermediate_state:updates.State = updates.Difference;
|
||||
|
||||
updatesTooLong#e317af7e = Updates;
|
||||
updateShortMessage#f7d91a46 flags:# id:int user_id:int message:string pts:int pts_count:int date:int fwd_from_id:flags.2?Peer fwd_date:flags.2?int reply_to_msg_id:flags.3?int entities:flags.7?Vector<MessageEntity> = Updates;
|
||||
updateShortChatMessage#cac7fdd2 flags:# id:int from_id:int chat_id:int message:string pts:int pts_count:int date:int fwd_from_id:flags.2?Peer fwd_date:flags.2?int reply_to_msg_id:flags.3?int entities:flags.7?Vector<MessageEntity> = Updates;
|
||||
updateShortMessage#f7d91a46 flags:# unread:flags.0?true out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true id:int user_id:int message:string pts:int pts_count:int date:int fwd_from_id:flags.2?Peer fwd_date:flags.2?int reply_to_msg_id:flags.3?int entities:flags.7?Vector<MessageEntity> = Updates;
|
||||
updateShortChatMessage#cac7fdd2 flags:# unread:flags.0?true out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true id:int from_id:int chat_id:int message:string pts:int pts_count:int date:int fwd_from_id:flags.2?Peer fwd_date:flags.2?int reply_to_msg_id:flags.3?int entities:flags.7?Vector<MessageEntity> = Updates;
|
||||
updateShort#78d4dec1 update:Update date:int = Updates;
|
||||
updatesCombined#725b04c3 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq_start:int seq:int = Updates;
|
||||
updates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;
|
||||
updateShortSentMessage#11f1331c flags:# id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector<MessageEntity> = Updates;
|
||||
updateShortSentMessage#11f1331c flags:# unread:flags.0?true out:flags.1?true id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector<MessageEntity> = Updates;
|
||||
|
||||
photos.photos#8dca6aa5 photos:Vector<Photo> users:Vector<User> = photos.Photos;
|
||||
photos.photosSlice#15051f54 count:int photos:Vector<Photo> users:Vector<User> = photos.Photos;
|
||||
|
@ -405,7 +413,7 @@ photos.photo#20212ca8 photo:Photo users:Vector<User> = photos.Photo;
|
|||
|
||||
upload.file#96a18d5 type:storage.FileType mtime:int bytes:bytes = upload.File;
|
||||
|
||||
dcOption#5d8c6cc flags:# id:int ip_address:string port:int = DcOption;
|
||||
dcOption#5d8c6cc flags:# ipv6:flags.0?true media_only:flags.1?true id:int ip_address:string port:int = DcOption;
|
||||
|
||||
config#4e32b894 date:int expires:int test_mode:Bool this_dc:int dc_options:Vector<DcOption> chat_size_max:int broadcast_size_max:int forwarded_count_max:int online_update_period_ms:int offline_blur_timeout_ms:int offline_idle_timeout_ms:int online_cloud_timeout_ms:int notify_cloud_delay_ms:int notify_default_delay_ms:int chat_big_size:int push_chat_period_ms:int push_chat_limit:int disabled_features:Vector<DisabledFeature> = Config;
|
||||
|
||||
|
@ -544,13 +552,13 @@ chatInviteEmpty#69df3769 = ExportedChatInvite;
|
|||
chatInviteExported#fc2e05bc link:string = ExportedChatInvite;
|
||||
|
||||
chatInviteAlready#5a686d7c chat:Chat = ChatInvite;
|
||||
chatInvite#93e99b60 flags:# title:string = ChatInvite;
|
||||
chatInvite#93e99b60 flags:# channel:flags.0?true broadcast:flags.1?true public:flags.2?true title:string = ChatInvite;
|
||||
|
||||
inputStickerSetEmpty#ffb62b95 = InputStickerSet;
|
||||
inputStickerSetID#9de7a269 id:long access_hash:long = InputStickerSet;
|
||||
inputStickerSetShortName#861cc8a0 short_name:string = InputStickerSet;
|
||||
|
||||
stickerSet#cd303b41 flags:# id:long access_hash:long title:string short_name:string count:int hash:int = StickerSet;
|
||||
stickerSet#cd303b41 flags:# installed:flags.0?true disabled:flags.1?true official:flags.2?true id:long access_hash:long title:string short_name:string count:int hash:int = StickerSet;
|
||||
|
||||
messages.stickerSet#b60a24a6 set:StickerSet packs:Vector<StickerPack> documents:Vector<Document> = messages.StickerSet;
|
||||
|
||||
|
@ -563,9 +571,9 @@ keyboardButton#a2fa4880 text:string = KeyboardButton;
|
|||
|
||||
keyboardButtonRow#77608b83 buttons:Vector<KeyboardButton> = KeyboardButtonRow;
|
||||
|
||||
replyKeyboardHide#a03e5b85 flags:# = ReplyMarkup;
|
||||
replyKeyboardForceReply#f4108aa0 flags:# = ReplyMarkup;
|
||||
replyKeyboardMarkup#3502758c flags:# rows:Vector<KeyboardButtonRow> = ReplyMarkup;
|
||||
replyKeyboardHide#a03e5b85 flags:# selective:flags.2?true = ReplyMarkup;
|
||||
replyKeyboardForceReply#f4108aa0 flags:# single_use:flags.1?true selective:flags.2?true = ReplyMarkup;
|
||||
replyKeyboardMarkup#3502758c flags:# resize:flags.0?true single_use:flags.1?true selective:flags.2?true rows:Vector<KeyboardButtonRow> = ReplyMarkup;
|
||||
|
||||
help.appChangelogEmpty#af7e0394 = help.AppChangelog;
|
||||
help.appChangelog#4668e6bd text:string = help.AppChangelog;
|
||||
|
@ -591,12 +599,12 @@ messageRange#ae30253 min_id:int max_id:int = MessageRange;
|
|||
|
||||
messageGroup#e8346f53 min_id:int max_id:int count:int date:int = MessageGroup;
|
||||
|
||||
updates.channelDifferenceEmpty#3e11affb flags:# pts:int timeout:flags.1?int = updates.ChannelDifference;
|
||||
updates.channelDifferenceTooLong#5e167646 flags:# pts:int timeout:flags.1?int top_message:int top_important_message:int read_inbox_max_id:int unread_count:int unread_important_count:int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = updates.ChannelDifference;
|
||||
updates.channelDifference#2064674e flags:# pts:int timeout:flags.1?int new_messages:Vector<Message> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> = updates.ChannelDifference;
|
||||
updates.channelDifferenceEmpty#3e11affb flags:# final:flags.0?true pts:int timeout:flags.1?int = updates.ChannelDifference;
|
||||
updates.channelDifferenceTooLong#5e167646 flags:# final:flags.0?true pts:int timeout:flags.1?int top_message:int top_important_message:int read_inbox_max_id:int unread_count:int unread_important_count:int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = updates.ChannelDifference;
|
||||
updates.channelDifference#2064674e flags:# final:flags.0?true pts:int timeout:flags.1?int new_messages:Vector<Message> other_updates:Vector<Update> chats:Vector<Chat> users:Vector<User> = updates.ChannelDifference;
|
||||
|
||||
channelMessagesFilterEmpty#94d42ee7 = ChannelMessagesFilter;
|
||||
channelMessagesFilter#cd77d957 flags:# ranges:Vector<MessageRange> = ChannelMessagesFilter;
|
||||
channelMessagesFilter#cd77d957 flags:# important_only:flags.0?true ranges:Vector<MessageRange> = ChannelMessagesFilter;
|
||||
channelMessagesFilterCollapsed#fa01232e = ChannelMessagesFilter;
|
||||
|
||||
channelParticipant#15ebac1d user_id:int date:int = ChannelParticipant;
|
||||
|
@ -687,15 +695,15 @@ contacts.resolveUsername#f93ccba3 username:string = contacts.ResolvedPeer;
|
|||
messages.getMessages#4222fa74 id:Vector<int> = messages.Messages;
|
||||
messages.getDialogs#859b3d3c offset:int limit:int = messages.Dialogs;
|
||||
messages.getHistory#8a8ec2da peer:InputPeer offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages;
|
||||
messages.search#d4569248 flags:# peer:InputPeer q:string filter:MessagesFilter min_date:int max_date:int offset:int max_id:int limit:int = messages.Messages;
|
||||
messages.search#d4569248 flags:# important_only:flags.0?true peer:InputPeer q:string filter:MessagesFilter min_date:int max_date:int offset:int max_id:int limit:int = messages.Messages;
|
||||
messages.readHistory#b04f2510 peer:InputPeer max_id:int offset:int = messages.AffectedHistory;
|
||||
messages.deleteHistory#f4f8fb61 peer:InputPeer offset:int = messages.AffectedHistory;
|
||||
messages.deleteMessages#a5f18925 id:Vector<int> = messages.AffectedMessages;
|
||||
messages.receivedMessages#5a954c0 max_id:int = Vector<ReceivedNotifyMessage>;
|
||||
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:# no_webpage:flags.1?true 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.forwardMessages#708e0195 flags:# from_peer:InputPeer id:Vector<int> random_id:Vector<long> to_peer:InputPeer = Updates;
|
||||
messages.forwardMessages#708e0195 flags:# broadcast:flags.4?true from_peer:InputPeer id:Vector<int> random_id:Vector<long> to_peer:InputPeer = Updates;
|
||||
messages.reportSpam#cf1592db peer:InputPeer = Bool;
|
||||
messages.getChats#3c6aa187 id:Vector<int> = messages.Chats;
|
||||
messages.getFullChat#3b831c66 chat_id:int = messages.ChatFull;
|
||||
|
@ -728,6 +736,8 @@ messages.installStickerSet#7b30c3a6 stickerset:InputStickerSet disabled:Bool = B
|
|||
messages.uninstallStickerSet#f96e55de stickerset:InputStickerSet = Bool;
|
||||
messages.startBot#1b3e0ffc bot:InputUser chat_id:int random_id:long start_param:string = Updates;
|
||||
messages.getMessagesViews#c4c8a55d peer:InputPeer id:Vector<int> increment:Bool = Vector<int>;
|
||||
messages.toggleChatAdmins#ec8bd9e1 chat_id:int enabled:Bool = Updates;
|
||||
messages.editChatAdmin#a9e69f2e chat_id:int user_id:InputUser is_admin:Bool = Bool;
|
||||
|
||||
updates.getState#edd4882a = updates.State;
|
||||
updates.getDifference#a041495 pts:int date:int qts:int = updates.Difference;
|
||||
|
@ -761,7 +771,7 @@ channels.getParticipants#24d98f92 channel:InputChannel filter:ChannelParticipant
|
|||
channels.getParticipant#546dd7a6 channel:InputChannel user_id:InputUser = channels.ChannelParticipant;
|
||||
channels.getChannels#a7f6bbb id:Vector<InputChannel> = messages.Chats;
|
||||
channels.getFullChannel#8736a09 channel:InputChannel = messages.ChatFull;
|
||||
channels.createChannel#5521d844 flags:# title:string about:string users:Vector<InputUser> = Updates;
|
||||
channels.createChannel#5521d844 flags:# broadcast:flags.0?true title:string about:string users:Vector<InputUser> = Updates;
|
||||
channels.editAbout#13e27f1e channel:InputChannel about:string = Bool;
|
||||
channels.editAdmin#52b16962 channel:InputChannel user_id:InputUser role:ChannelParticipantRole = Bool;
|
||||
channels.editTitle#566decd0 channel:InputChannel title:string = Updates;
|
||||
|
|
|
@ -951,7 +951,7 @@ int32 OverviewInner::itemTop(const FullMsgId &msgId) const {
|
|||
void OverviewInner::preloadMore() {
|
||||
if (_inSearch) {
|
||||
if (!_searchRequest && !_searchFull) {
|
||||
int32 flags = _hist->peer->isChannel() ? MTPmessages_Search_flag_only_important : 0;
|
||||
int32 flags = _hist->peer->isChannel() ? MTPmessages_Search::flag_important_only : 0;
|
||||
_searchRequest = MTP::send(MTPmessages_Search(MTP_int(flags), _hist->peer->input, MTP_string(_searchQuery), MTP_inputMessagesFilterUrl(), MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(_lastSearchId), MTP_int(SearchPerPage)), rpcDone(&OverviewInner::searchReceived, !_lastSearchId), rpcFail(&OverviewInner::searchFailed));
|
||||
if (!_lastSearchId) {
|
||||
_searchQueries.insert(_searchRequest, _searchQuery);
|
||||
|
@ -2034,7 +2034,7 @@ bool OverviewInner::onSearchMessages(bool searchCache) {
|
|||
} else if (_searchQuery != q) {
|
||||
_searchQuery = q;
|
||||
_searchFull = false;
|
||||
int32 flags = _hist->peer->isChannel() ? MTPmessages_Search_flag_only_important : 0;
|
||||
int32 flags = _hist->peer->isChannel() ? MTPmessages_Search::flag_important_only : 0;
|
||||
_searchRequest = MTP::send(MTPmessages_Search(MTP_int(flags), _hist->peer->input, MTP_string(_searchQuery), MTP_inputMessagesFilterUrl(), MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(0), MTP_int(SearchPerPage)), rpcDone(&OverviewInner::searchReceived, true), rpcFail(&OverviewInner::searchFailed));
|
||||
_searchQueries.insert(_searchRequest, _searchQuery);
|
||||
}
|
||||
|
|
|
@ -2603,7 +2603,7 @@ public:
|
|||
bool tomsg = !history->peer->isUser() && (_msgId > 0);
|
||||
if (tomsg) {
|
||||
HistoryItem *item = App::histItemById(peerToChannel(_peerId), _msgId);
|
||||
if (!item || !item->notifyByFrom()) {
|
||||
if (!item || !item->mentionsMe()) {
|
||||
tomsg = false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -921,7 +921,7 @@ void SettingsInner::gotPassword(const MTPaccount_Password &result) {
|
|||
case mtpc_account_password: {
|
||||
const MTPDaccount_password &d(result.c_account_password());
|
||||
_curPasswordSalt = qba(d.vcurrent_salt);
|
||||
_hasPasswordRecovery = d.vhas_recovery.v;
|
||||
_hasPasswordRecovery = mtpIsTrue(d.vhas_recovery);
|
||||
_curPasswordHint = qs(d.vhint);
|
||||
_newPasswordSalt = qba(d.vnew_salt);
|
||||
QString pattern = qs(d.vemail_unconfirmed_pattern);
|
||||
|
|
|
@ -477,25 +477,25 @@ public:
|
|||
int32 version;
|
||||
int32 flags, flagsFull;
|
||||
bool isBroadcast() const {
|
||||
return flags & MTPDchannel_flag_is_broadcast;
|
||||
return flags & MTPDchannel::flag_broadcast;
|
||||
}
|
||||
bool isPublic() const {
|
||||
return flags & MTPDchannel::flag_username;
|
||||
}
|
||||
bool amCreator() const {
|
||||
return flags & MTPDchannel_flag_am_creator;
|
||||
return flags & MTPDchannel::flag_creator;
|
||||
}
|
||||
bool amEditor() const {
|
||||
return flags & MTPDchannel_flag_am_editor;
|
||||
return flags & MTPDchannel::flag_editor;
|
||||
}
|
||||
bool amModerator() const {
|
||||
return flags & MTPDchannel_flag_am_moderator;
|
||||
return flags & MTPDchannel::flag_moderator;
|
||||
}
|
||||
bool haveLeft() const {
|
||||
return flags & MTPDchannel_flag_have_left;
|
||||
return flags & MTPDchannel::flag_left;
|
||||
}
|
||||
bool wasKicked() const {
|
||||
return flags & MTPDchannel_flag_was_kicked;
|
||||
return flags & MTPDchannel::flag_kicked;
|
||||
}
|
||||
bool amIn() const {
|
||||
return !isForbidden && !haveLeft() && !wasKicked();
|
||||
|
@ -504,11 +504,11 @@ public:
|
|||
return amCreator() || amEditor();
|
||||
}
|
||||
bool canViewParticipants() const {
|
||||
return flagsFull & MTPDchannelFull_flag_can_view_participants;
|
||||
return flagsFull & MTPDchannelFull::flag_can_view_participants;
|
||||
}
|
||||
bool isForbidden;
|
||||
bool isVerified() const {
|
||||
return flags & MTPDchannel_flag_is_verified;
|
||||
return flags & MTPDchannel::flag_verified;
|
||||
}
|
||||
|
||||
int32 botStatus; // -1 - no bots, 0 - unknown, 1 - one bot, that sees all history, 2 - other
|
||||
|
@ -586,7 +586,7 @@ inline const QString &PeerData::userName() const {
|
|||
}
|
||||
|
||||
inline int32 newMessageFlags(PeerData *p) {
|
||||
return p->isSelf() ? 0 : (((p->isChat() || (p->isUser() && !p->asUser()->botInfo)) ? MTPDmessage_flag_unread : 0) | MTPDmessage_flag_out);
|
||||
return p->isSelf() ? 0 : (((p->isChat() || (p->isUser() && !p->asUser()->botInfo)) ? MTPDmessage::flag_unread : 0) | MTPDmessage::flag_out);
|
||||
}
|
||||
|
||||
typedef QMap<char, QPixmap> PreparedPhotoThumbs;
|
||||
|
|
|
@ -295,7 +295,7 @@ void NotifyWindow::mousePressEvent(QMouseEvent *e) {
|
|||
App::wnd()->notifyClear();
|
||||
} else {
|
||||
App::wnd()->hideSettings();
|
||||
App::main()->showPeerHistory(peer, (!history->peer->isUser() && item && item->notifyByFrom() && item->id > 0) ? item->id : ShowAtUnreadMsgId);
|
||||
App::main()->showPeerHistory(peer, (!history->peer->isUser() && item && item->mentionsMe() && item->id > 0) ? item->id : ShowAtUnreadMsgId);
|
||||
}
|
||||
e->ignore();
|
||||
}
|
||||
|
@ -1305,7 +1305,7 @@ void Window::quit() {
|
|||
void Window::notifySchedule(History *history, HistoryItem *item) {
|
||||
if (App::quiting() || !history->currentNotification() || !main) return;
|
||||
|
||||
PeerData *notifyByFrom = (!history->peer->isUser() && item->notifyByFrom()) ? item->from() : 0;
|
||||
PeerData *notifyByFrom = (!history->peer->isUser() && item->mentionsMe()) ? item->from() : 0;
|
||||
|
||||
bool haveSetting = (history->peer->notify != UnknownNotifySettings);
|
||||
if (haveSetting) {
|
||||
|
|
Loading…
Reference in New Issue