From 84436a34b02a0c9453a86d2b4fc5f81f77b27dc6 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 30 Aug 2015 17:57:21 +0300 Subject: [PATCH] gifs and pdfs attached by link, prepare for 0.8.54 stable version --- Telegram/SourceFiles/app.cpp | 30 +- Telegram/SourceFiles/app.h | 2 +- Telegram/SourceFiles/boxes/contactsbox.cpp | 2 + Telegram/SourceFiles/gui/flattextarea.cpp | 11 +- Telegram/SourceFiles/gui/flattextarea.h | 3 +- Telegram/SourceFiles/gui/text.h | 2 +- Telegram/SourceFiles/history.cpp | 260 ++- Telegram/SourceFiles/history.h | 18 +- Telegram/SourceFiles/historywidget.cpp | 19 +- Telegram/SourceFiles/mainwidget.cpp | 187 +- Telegram/SourceFiles/mainwidget.h | 12 +- .../SourceFiles/mtproto/mtpConnection.cpp | 2 +- Telegram/SourceFiles/mtproto/mtpCoreTypes.h | 2 +- Telegram/SourceFiles/mtproto/mtpScheme.cpp | 452 +---- Telegram/SourceFiles/mtproto/mtpScheme.h | 1766 +---------------- Telegram/SourceFiles/mtproto/scheme.tl | 54 +- Telegram/SourceFiles/overviewwidget.cpp | 2 + Telegram/SourceFiles/structs.cpp | 4 +- Telegram/SourceFiles/structs.h | 16 +- 19 files changed, 510 insertions(+), 2334 deletions(-) diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 7b36392db..07baf8abb 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -526,26 +526,6 @@ namespace App { data->left = false; data->forbidden = true; } break; - case mtpc_geoChat: { - const MTPDgeoChat &d(chat.c_geoChat()); - data = 0; -/* title = qs(d.vtitle); - - PeerId peer(peerFromChat(d.vid.v)); - data = App::chat(peer); - data->input = MTP_inputPeerChat(d.vid); - data->setPhoto(d.vphoto); - data->date = d.vdate.v; - data->count = d.vparticipants_count.v; - data->left = false; - data->forbidden = false; - data->access = d.vaccess_hash.v; - if (data->version < d.vversion.v) { - data->version = d.vversion.v; - data->participants = ChatData::Participants(); - data->botStatus = 0; - }/**/ - } break; } if (!data) continue; @@ -1075,11 +1055,11 @@ namespace App { } WebPageData *feedWebPage(const MTPDwebPage &webpage, WebPageData *convert) { - return App::webPageSet(webpage.vid.v, convert, webpage.has_type() ? qs(webpage.vtype) : qsl("article"), qs(webpage.vurl), qs(webpage.vdisplay_url), webpage.has_site_name() ? qs(webpage.vsite_name) : QString(), webpage.has_title() ? qs(webpage.vtitle) : QString(), webpage.has_description() ? qs(webpage.vdescription) : QString(), webpage.has_photo() ? App::feedPhoto(webpage.vphoto) : 0, webpage.has_duration() ? webpage.vduration.v : 0, webpage.has_author() ? qs(webpage.vauthor) : QString(), 0); + return App::webPageSet(webpage.vid.v, convert, webpage.has_type() ? qs(webpage.vtype) : qsl("article"), qs(webpage.vurl), qs(webpage.vdisplay_url), webpage.has_site_name() ? qs(webpage.vsite_name) : QString(), webpage.has_title() ? qs(webpage.vtitle) : QString(), webpage.has_description() ? qs(webpage.vdescription) : QString(), webpage.has_photo() ? App::feedPhoto(webpage.vphoto) : 0, webpage.has_document() ? App::feedDocument(webpage.vdocument) : 0, webpage.has_duration() ? webpage.vduration.v : 0, webpage.has_author() ? qs(webpage.vauthor) : QString(), 0); } WebPageData *feedWebPage(const MTPDwebPagePending &webpage, WebPageData *convert) { - return App::webPageSet(webpage.vid.v, convert, QString(), QString(), QString(), QString(), QString(), QString(), 0, 0, QString(), webpage.vdate.v); + return App::webPageSet(webpage.vid.v, convert, QString(), QString(), QString(), QString(), QString(), QString(), 0, 0, 0, QString(), webpage.vdate.v); } WebPageData *feedWebPage(const MTPWebPage &webpage) { @@ -1433,7 +1413,7 @@ namespace App { return i.value(); } - WebPageData *webPageSet(const WebPageId &webPage, WebPageData *convert, const QString &type, const QString &url, const QString &displayUrl, const QString &siteName, const QString &title, const QString &description, PhotoData *photo, int32 duration, const QString &author, int32 pendingTill) { + WebPageData *webPageSet(const WebPageId &webPage, WebPageData *convert, const QString &type, const QString &url, const QString &displayUrl, const QString &siteName, const QString &title, const QString &description, PhotoData *photo, DocumentData *doc, int32 duration, const QString &author, int32 pendingTill) { if (convert) { if (convert->id != webPage) { WebPagesData::iterator i = webPagesData.find(convert->id); @@ -1450,6 +1430,7 @@ namespace App { convert->title = title; convert->description = description; convert->photo = photo; + convert->doc = doc; convert->duration = duration; convert->author = author; if (convert->pendingTill > 0 && pendingTill <= 0 && api()) api()->clearWebPageRequest(convert); @@ -1463,7 +1444,7 @@ namespace App { if (convert) { result = convert; } else { - result = new WebPageData(webPage, toWebPageType(type), url, displayUrl, siteName, title, description, photo, duration, author, (pendingTill >= -1) ? pendingTill : -1); + result = new WebPageData(webPage, toWebPageType(type), url, displayUrl, siteName, title, description, photo, doc, duration, author, (pendingTill >= -1) ? pendingTill : -1); if (pendingTill > 0 && api()) { api()->requestWebPageDelayed(result); } @@ -1480,6 +1461,7 @@ namespace App { result->title = title; result->description = description; result->photo = photo; + result->doc = doc; result->duration = duration; result->author = author; if (result->pendingTill > 0 && pendingTill <= 0 && api()) api()->clearWebPageRequest(result); diff --git a/Telegram/SourceFiles/app.h b/Telegram/SourceFiles/app.h index 093b34395..358622cf3 100644 --- a/Telegram/SourceFiles/app.h +++ b/Telegram/SourceFiles/app.h @@ -172,7 +172,7 @@ namespace App { DocumentData *document(const DocumentId &document); DocumentData *documentSet(const DocumentId &document, DocumentData *convert, const uint64 &access, int32 date, const QVector &attributes, const QString &mime, const ImagePtr &thumb, int32 dc, int32 size, const StorageImageLocation &thumbLocation); WebPageData *webPage(const WebPageId &webPage); - WebPageData *webPageSet(const WebPageId &webPage, WebPageData *convert, const QString &, const QString &url, const QString &displayUrl, const QString &siteName, const QString &title, const QString &description, PhotoData *photo, int32 duration, const QString &author, int32 pendingTill); + WebPageData *webPageSet(const WebPageId &webPage, WebPageData *convert, const QString &, const QString &url, const QString &displayUrl, const QString &siteName, const QString &title, const QString &description, PhotoData *photo, DocumentData *doc, int32 duration, const QString &author, int32 pendingTill); ImageLinkData *imageLink(const QString &imageLink); ImageLinkData *imageLinkSet(const QString &imageLink, ImageLinkType type, const QString &url); void forgetMedia(); diff --git a/Telegram/SourceFiles/boxes/contactsbox.cpp b/Telegram/SourceFiles/boxes/contactsbox.cpp index c5cec8baa..00933bcb2 100644 --- a/Telegram/SourceFiles/boxes/contactsbox.cpp +++ b/Telegram/SourceFiles/boxes/contactsbox.cpp @@ -1271,6 +1271,8 @@ void CreateGroupBox::created(const MTPUpdates &updates) { } break; case mtpc_updateShortChatMessage: { } break; + case mtpc_updateShortSentMessage: { + } break; case mtpc_updatesTooLong: { } break; } diff --git a/Telegram/SourceFiles/gui/flattextarea.cpp b/Telegram/SourceFiles/gui/flattextarea.cpp index 741a69901..0e3a6a72d 100644 --- a/Telegram/SourceFiles/gui/flattextarea.cpp +++ b/Telegram/SourceFiles/gui/flattextarea.cpp @@ -24,7 +24,7 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org FlatTextarea::FlatTextarea(QWidget *parent, const style::flatTextarea &st, const QString &pholder, const QString &v) : QTextEdit(v, parent), _ph(pholder), _oldtext(v), _phVisible(!v.length()), a_phLeft(_phVisible ? 0 : st.phShift), a_phAlpha(_phVisible ? 1 : 0), a_phColor(st.phColor->c), - _st(st), _undoAvailable(false), _redoAvailable(false), _fakeMargin(0), + _st(st), _undoAvailable(false), _redoAvailable(false), _inDrop(false), _fakeMargin(0), _touchPress(false), _touchRightButton(false), _touchMove(false), _replacingEmojis(false) { setAcceptRichText(false); resize(_st.width, _st.font->height); @@ -530,7 +530,7 @@ QStringList FlatTextarea::linksList() const { void FlatTextarea::insertFromMimeData(const QMimeData *source) { QTextEdit::insertFromMimeData(source); - emit spacedReturnedPasted(); + if (!_inDrop) emit spacedReturnedPasted(); } void FlatTextarea::insertEmoji(EmojiPtr emoji, QTextCursor c) { @@ -818,3 +818,10 @@ void FlatTextarea::resizeEvent(QResizeEvent *e) { void FlatTextarea::mousePressEvent(QMouseEvent *e) { QTextEdit::mousePressEvent(e); } + +void FlatTextarea::dropEvent(QDropEvent *e) { + _inDrop = true; + QTextEdit::dropEvent(e); + _inDrop = false; + emit spacedReturnedPasted(); +} diff --git a/Telegram/SourceFiles/gui/flattextarea.h b/Telegram/SourceFiles/gui/flattextarea.h index 0173e284b..3bdc42dc3 100644 --- a/Telegram/SourceFiles/gui/flattextarea.h +++ b/Telegram/SourceFiles/gui/flattextarea.h @@ -36,6 +36,7 @@ public: void keyPressEvent(QKeyEvent *e); void resizeEvent(QResizeEvent *e); void mousePressEvent(QMouseEvent *e); + void dropEvent(QDropEvent *e); const QString &getLastText() const; void updatePlaceholder(); @@ -119,7 +120,7 @@ private: anim::cvalue a_phColor; style::flatTextarea _st; - bool _undoAvailable, _redoAvailable; + bool _undoAvailable, _redoAvailable, _inDrop; int32 _fakeMargin; diff --git a/Telegram/SourceFiles/gui/text.h b/Telegram/SourceFiles/gui/text.h index 3fd48128e..bfc3749f0 100644 --- a/Telegram/SourceFiles/gui/text.h +++ b/Telegram/SourceFiles/gui/text.h @@ -636,7 +636,7 @@ inline bool chIsSpace(QChar ch, bool rich = false) { return ch.isSpace() || (ch < 32 && !(rich && ch == TextCommand)) || (ch == QChar::ParagraphSeparator) || (ch == QChar::LineSeparator) || (ch == QChar::ObjectReplacementCharacter) || (ch == QChar::SoftHyphen) || (ch == QChar::CarriageReturn) || (ch == QChar::Tabulation); } inline bool chIsBad(QChar ch) { - return (ch == 0) || (ch >= 8232 && ch < 8239) || (ch >= 65024 && ch < 65040 && ch != 65039) || (ch >= 127 && ch < 160 && ch != 156); + return (ch == 0) || (ch >= 8232 && ch < 8237) || (ch >= 65024 && ch < 65040 && ch != 65039) || (ch >= 127 && ch < 160 && ch != 156); } inline bool chIsTrimmed(QChar ch, bool rich = false) { return (!rich || ch != TextCommand) && (chIsSpace(ch) || chIsBad(ch)); diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index 26a684d24..1361ad544 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -647,7 +647,7 @@ HistoryItem *History::createItem(HistoryBlock *block, const MTPmessage &msg, boo const QVector *entities = 0; switch (msg.type()) { case mtpc_message: - media = &msg.c_message().vmedia; + media = msg.c_message().has_media() ? (&msg.c_message().vmedia) : 0; entities = msg.c_message().has_entities() ? (&msg.c_message().ventities.c_vector().v) : 0; break; } @@ -673,7 +673,7 @@ HistoryItem *History::createItem(HistoryBlock *block, const MTPmessage &msg, boo case mtpc_message: { const MTPDmessage m(msg.c_message()); int badMedia = 0; // 1 - unsupported, 2 - empty - switch (m.vmedia.type()) { + if (m.has_media()) switch (m.vmedia.type()) { case mtpc_messageMediaEmpty: case mtpc_messageMediaContact: break; case mtpc_messageMediaGeo: @@ -2269,15 +2269,11 @@ HistoryVideo::HistoryVideo(const MTPDvideo &video, const QString &caption, Histo int32 tw = data->thumb->width(), th = data->thumb->height(); if (data->thumb->isNull() || !tw || !th) { - _thumbw = _thumbx = _thumby = 0; + _thumbw = 0; } else if (tw > th) { _thumbw = (tw * st::mediaThumbSize) / th; - _thumbx = (_thumbw - st::mediaThumbSize) / 2; - _thumby = 0; } else { _thumbw = st::mediaThumbSize; - _thumbx = 0; - _thumby = ((th * _thumbw) / tw - st::mediaThumbSize) / 2; } } @@ -2964,15 +2960,11 @@ HistoryDocument::HistoryDocument(DocumentData *document) : HistoryMedia() int32 tw = data->thumb->width(), th = data->thumb->height(); if (data->thumb->isNull() || !tw || !th) { - _thumbw = _thumbx = _thumby = 0; + _thumbw = 0; } else if (tw > th) { _thumbw = (tw * st::mediaThumbSize) / th; - _thumbx = (_thumbw - st::mediaThumbSize) / 2; - _thumby = 0; } else { _thumbw = st::mediaThumbSize; - _thumbx = 0; - _thumby = ((th * _thumbw) / tw - st::mediaThumbSize) / 2; } } @@ -3447,17 +3439,7 @@ HistoryMedia *HistoryDocument::clone() const { } ImagePtr HistoryDocument::replyPreview() { - if (data->replyPreview->isNull() && !data->thumb->isNull()) { - if (data->thumb->loaded()) { - int w = data->thumb->width(), h = data->thumb->height(); - if (w <= 0) w = 1; - if (h <= 0) h = 1; - data->replyPreview = ImagePtr(w > h ? data->thumb->pix(w * st::msgReplyBarSize.height() / h, st::msgReplyBarSize.height()) : data->thumb->pix(st::msgReplyBarSize.height()), "PNG"); - } else { - data->thumb->load(); - } - } - return data->replyPreview; + return data->makeReplyPreview(); } HistorySticker::HistorySticker(DocumentData *document) : HistoryMedia() @@ -3851,14 +3833,30 @@ void HistoryContact::updateFrom(const MTPMessageMedia &media) { HistoryWebPage::HistoryWebPage(WebPageData *data) : HistoryMedia() , data(data) , _openl(data->url.isEmpty() ? 0 : new TextLink(data->url)) -, _photol((data->photo && data->type != WebPageVideo) ? new PhotoLink(data->photo) : 0) +, _attachl((data->photo && data->type != WebPageVideo) ? static_cast(new PhotoLink(data->photo)) : static_cast(data->doc ? new DocumentOpenLink(data->doc) : 0)) , _asArticle(false) , _title(st::msgMinWidth - st::webPageLeft) , _description(st::msgMinWidth - st::webPageLeft) , _siteNameWidth(0) +, _docSize(data->doc ? (data->doc->song() ? formatDurationAndSizeText(data->doc->song()->duration, data->doc->size) : formatSizeText(data->doc->size)) : QString()) +, _docName(data->doc ? documentName(data->doc) : QString()) , _durationWidth(0) +, _docNameWidth(data->doc ? (st::mediaFont->m.width(_docName.isEmpty() ? qsl("Document") : _docName)) : 0) +, _docDownloadDone(0) , _pixw(0), _pixh(0) { + if (data->doc) { + data->doc->thumb->load(); + + int32 tw = data->doc->thumb->width(), th = data->doc->thumb->height(); + if (data->doc->thumb->isNull() || !tw || !th) { + _docThumbWidth = 0; + } else if (tw > th) { + _docThumbWidth = (tw * st::mediaThumbSize) / th; + } else { + _docThumbWidth = st::mediaThumbSize; + } + } } void HistoryWebPage::initDimensions(const HistoryItem *parent) { @@ -3870,7 +3868,8 @@ void HistoryWebPage::initDimensions(const HistoryItem *parent) { return; } if (!_openl && !data->url.isEmpty()) _openl = TextLinkPtr(new TextLink(data->url)); - if (!_photol && data->photo && data->type != WebPageVideo) _photol = TextLinkPtr(new PhotoLink(data->photo)); + if (!_attachl && data->photo && data->type != WebPageVideo) _attachl = TextLinkPtr(new PhotoLink(data->photo)); + if (!_attachl && data->doc) _attachl = TextLinkPtr(new DocumentOpenLink(data->doc)); if (data->photo && data->type != WebPagePhoto && data->type != WebPageVideo) { if (data->type == WebPageProfile) { _asArticle = true; @@ -3908,6 +3907,15 @@ void HistoryWebPage::initDimensions(const HistoryItem *parent) { _maxw = st::webPageLeft + qMax(thumbh, qMax(w, int32(st::minPhotoSize))) + parent->timeWidth(true); _minh = qMax(thumbh, int32(st::minPhotoSize)); _minh += st::webPagePhotoSkip; + } else if (data->doc) { + if (parent == animated.msg) { + _maxw = st::webPageLeft + (animated.w / cIntRetinaFactor()) + parent->timeWidth(true); + _minh = animated.h / cIntRetinaFactor(); + _minh += st::webPagePhotoSkip; + } else { + _maxw = qMax(st::webPageLeft + st::mediaThumbSize + st::mediaPadding.right() + _docNameWidth + st::mediaPadding.right(), st::mediaMaxWidth); + _minh = st::mediaThumbSize; + } } else { _maxw = st::webPageLeft; _minh = 0; @@ -3951,7 +3959,7 @@ void HistoryWebPage::initDimensions(const HistoryItem *parent) { _minh += qMin(_description.minHeight(), 3 * st::webPageTitleFont->height); } } - if (!_asArticle && data->photo && (_siteNameWidth || !_title.isEmpty() || !_description.isEmpty())) { + if (!_asArticle && (data->photo || data->doc) && (_siteNameWidth || !_title.isEmpty() || !_description.isEmpty())) { _minh += st::webPagePhotoSkip; } if (data->type == WebPageVideo && data->duration) { @@ -3965,15 +3973,29 @@ void HistoryWebPage::draw(QPainter &p, const HistoryItem *parent, bool selected, if (width < 0) width = w; if (width < 1 || data->pendingTill) return; - int32 bottomSkip = 0; - //if (!data->pendingTill) { - if (data->photo) { - bottomSkip += st::webPagePhotoSkip; - if (_asArticle || (st::webPageLeft + qMax(_pixw, int16(st::minPhotoSize)) + parent->timeWidth(true) > width)) { - bottomSkip += (st::msgDateFont->height - st::msgDateDelta.y()); - } + int16 animw = 0, animh = 0; + if (data->doc && animated.msg == parent) { + animw = animated.w / cIntRetinaFactor(); + animh = animated.h / cIntRetinaFactor(); + if (width - st::webPageLeft < animw) { + animw = width - st::webPageLeft; + animh = (animw * animated.h / animated.w); + if (animh < 1) animh = 1; } - //} + } + + int32 bottomSkip = 0; + if (data->photo) { + bottomSkip += st::webPagePhotoSkip; + if (_asArticle || (st::webPageLeft + qMax(_pixw, int16(st::minPhotoSize)) + parent->timeWidth(true) > width)) { + bottomSkip += (st::msgDateFont->height - st::msgDateDelta.y()); + } + } else if (data->doc && animated.msg == parent) { + bottomSkip += st::webPagePhotoSkip; + if (st::webPageLeft + qMax(animw, int16(st::minPhotoSize)) + parent->timeWidth(true) > width) { + bottomSkip += (st::msgDateFont->height - st::msgDateDelta.y()); + } + } style::color bar = (selected ? (parent->out() ? st::msgOutReplyBarSelColor : st::msgInReplyBarSelColor) : (parent->out() ? st::msgOutReplyBarColor : st::msgInReplyBarColor)); style::color semibold = (selected ? (parent->out() ? st::msgOutServiceSelColor : st::msgInServiceSelColor) : (parent->out() ? st::msgOutServiceColor : st::msgInServiceColor)); @@ -4115,6 +4137,100 @@ void HistoryWebPage::draw(QPainter &p, const HistoryItem *parent, bool selected, } p.translate(0, pixheight); + } else if (!_asArticle && data->doc) { + if (_siteNameWidth || !_title.isEmpty() || !_description.isEmpty()) { + p.translate(0, st::webPagePhotoSkip); + } + + if (parent == animated.msg) { + p.drawPixmap(0, 0, animated.current(animw * cIntRetinaFactor(), animh * cIntRetinaFactor(), true)); + if (selected) { + App::roundRect(p, 0, 0, animw, animh, textstyleCurrent()->selectOverlay, SelectedOverlayCorners); + } + } else { + QString statusText; + if (data->doc->song()) { + SongMsgId playing; + AudioPlayerState playingState = AudioPlayerStopped; + int64 playingPosition = 0, playingDuration = 0; + int32 playingFrequency = 0; + if (audioPlayer()) { + audioPlayer()->currentState(&playing, &playingState, &playingPosition, &playingDuration, &playingFrequency); + } + + bool already = !data->doc->already().isEmpty(), hasdata = !data->doc->data.isEmpty(); + QRect img; + if (data->doc->status == FileFailed) { + statusText = lang(lng_attach_failed); + img = parent->out() ? st::mediaMusicOutImg : st::mediaMusicInImg; + } else if (already || hasdata) { + bool showPause = false; + if (playing.msgId == parent->id && !(playingState & AudioPlayerStoppedMask) && playingState != AudioPlayerFinishing) { + statusText = formatDurationText(playingPosition / (playingFrequency ? playingFrequency : AudioVoiceMsgFrequency)) + qsl(" / ") + formatDurationText(playingDuration / (playingFrequency ? playingFrequency : AudioVoiceMsgFrequency)); + showPause = (playingState == AudioPlayerPlaying || playingState == AudioPlayerResuming || playingState == AudioPlayerStarting); + } else { + statusText = formatDurationText(data->doc->song()->duration); + } + if (!showPause && playing.msgId == parent->id && App::main() && App::main()->player()->seekingSong(playing)) showPause = true; + img = parent->out() ? (showPause ? st::mediaPauseOutImg : st::mediaPlayOutImg) : (showPause ? st::mediaPauseInImg : st::mediaPlayInImg); + } else { + if (data->doc->loader) { + int32 offset = data->doc->loader->currentOffset(); + if (_docDownloadTextCache.isEmpty() || _docDownloadDone != offset) { + _docDownloadDone = offset; + _docDownloadTextCache = formatDownloadText(_docDownloadDone, data->doc->size); + } + statusText = _docDownloadTextCache; + } else { + statusText = _docSize; + } + img = parent->out() ? st::mediaMusicOutImg : st::mediaMusicInImg; + } + + p.drawPixmap(QPoint(0, 0), App::sprite(), img); + } else { + if (data->doc->status == FileFailed) { + statusText = lang(lng_attach_failed); + } else if (data->doc->loader) { + int32 offset = data->doc->loader->currentOffset(); + if (_docDownloadTextCache.isEmpty() || _docDownloadDone != offset) { + _docDownloadDone = offset; + _docDownloadTextCache = formatDownloadText(_docDownloadDone, data->doc->size); + } + statusText = _docDownloadTextCache; + } else { + statusText = _docSize; + } + + if (_docThumbWidth) { + data->doc->thumb->checkload(); + p.drawPixmap(QPoint(0, 0), data->doc->thumb->pixSingle(_docThumbWidth, 0, st::mediaThumbSize, st::mediaThumbSize)); + } else { + p.drawPixmap(QPoint(0, 0), App::sprite(), (parent->out() ? st::mediaDocOutImg : st::mediaDocInImg)); + } + } + if (selected) { + App::roundRect(p, 0, 0, st::mediaThumbSize, st::mediaThumbSize, textstyleCurrent()->selectOverlay, SelectedOverlayCorners); + } + + int32 tleft = st::mediaPadding.left() + st::mediaThumbSize + st::mediaPadding.right(); + int32 twidth = width - tleft - st::mediaPadding.right(); + int32 fullTimeWidth = parent->timeWidth(true) + st::msgPadding.right(); + int32 secondwidth = width - tleft - fullTimeWidth; + + p.setFont(st::mediaFont->f); + p.setPen(st::black->c); + if (twidth < _docNameWidth) { + p.drawText(tleft, st::mediaNameTop + st::mediaFont->ascent, st::mediaFont->m.elidedText(_docName, Qt::ElideRight, twidth)); + } else { + p.drawText(tleft, st::mediaNameTop + st::mediaFont->ascent, _docName); + } + + style::color status(selected ? (parent->out() ? st::mediaOutSelectColor : st::mediaInSelectColor) : (parent->out() ? st::mediaOutColor : st::mediaInColor)); + p.setPen(status->p); + + p.drawText(tleft, st::mediaThumbSize - st::mediaDetailsShift - st::mediaFont->descent, statusText); + } } p.restore(); @@ -4147,7 +4263,7 @@ int32 HistoryWebPage::resize(int32 width, bool dontRecountText, const HistoryIte _height = st::webPagePhotoSize; _height += st::webPagePhotoSkip + (st::msgDateFont->height - st::msgDateDelta.y()); } else if (data->photo) { - _pixw = qMin(width, int32(_maxw - st::webPageLeft)); + _pixw = qMin(width, int32(_maxw - st::webPageLeft - parent->timeWidth(true))); int32 tw = convertScale(data->photo->full->width()), th = convertScale(data->photo->full->height()); if (tw > st::maxMediaSize) { @@ -4175,6 +4291,24 @@ int32 HistoryWebPage::resize(int32 width, bool dontRecountText, const HistoryIte if (qMax(_pixw, int16(st::minPhotoSize)) + parent->timeWidth(true) > width) { _height += (st::msgDateFont->height - st::msgDateDelta.y()); } + } else if (data->doc) { + if (parent == animated.msg) { + int32 w = qMin(width, int32(animated.w / cIntRetinaFactor())); + if (w > st::maxMediaSize) { + w = st::maxMediaSize; + } + _height = animated.h / cIntRetinaFactor(); + if (animated.w / cIntRetinaFactor() > w) { + _height = (w * _height / (animated.w / cIntRetinaFactor())); + if (_height <= 0) _height = 1; + } + _height += st::webPagePhotoSkip; + if (w + parent->timeWidth(true) > width) { + _height += (st::msgDateFont->height - st::msgDateDelta.y()); + } + } else { + _height = st::mediaThumbSize; + } } else { _height = 0; } @@ -4189,7 +4323,7 @@ int32 HistoryWebPage::resize(int32 width, bool dontRecountText, const HistoryIte if (!_description.isEmpty()) { _height += qMin(_description.countHeight(width), st::webPageDescriptionFont->height * 3); } - if (data->photo && (_siteNameWidth || !_title.isEmpty() || !_description.isEmpty())) { + if ((data->photo || data->doc) && (_siteNameWidth || !_title.isEmpty() || !_description.isEmpty())) { _height += st::webPagePhotoSkip; } } @@ -4199,10 +4333,12 @@ int32 HistoryWebPage::resize(int32 width, bool dontRecountText, const HistoryIte void HistoryWebPage::regItem(HistoryItem *item) { App::regWebPageItem(data, item); + if (data->doc) App::regDocumentItem(data->doc, item); } void HistoryWebPage::unregItem(HistoryItem *item) { App::unregWebPageItem(data, item); + if (data->doc) App::unregDocumentItem(data->doc, item); } const QString HistoryWebPage::inDialogsText() const { @@ -4274,10 +4410,20 @@ void HistoryWebPage::getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 y -= st::webPagePhotoSkip; } if (!_asArticle) { - int32 pixwidth = qMax(_pixw, int16(st::minPhotoSize)), pixheight = qMax(_pixh, int16(st::minPhotoSize)); - if (x >= 0 && y >= 0 && x < pixwidth && y < pixheight) { - lnk = _photol ? _photol : _openl; - return; + if (data->doc && parent == animated.msg) { + int32 h = (width == w) ? _height : (width * animated.h / animated.w); + if (h < 1) h = 1; + if (x >= 0 && y >= 0 && x < width && y < h) { + lnk = _attachl; + return; + } + } else { + int32 attachwidth = data->doc ? (width - st::mediaPadding.right()) : qMax(_pixw, int16(st::minPhotoSize)); + int32 attachheight = data->doc ? st::mediaThumbSize : qMax(_pixh, int16(st::minPhotoSize)); + if (x >= 0 && y >= 0 && x < attachwidth && y < attachheight) { + lnk = _attachl ? _attachl : _openl; + return; + } } } } @@ -4287,7 +4433,7 @@ HistoryMedia *HistoryWebPage::clone() const { } ImagePtr HistoryWebPage::replyPreview() { - return data->photo ? data->photo->makeReplyPreview() : ImagePtr(); + return data->photo ? data->photo->makeReplyPreview() : (data->doc ? data->doc->makeReplyPreview() : ImagePtr()); } namespace { @@ -5036,11 +5182,11 @@ HistoryMessage::HistoryMessage(History *history, HistoryBlock *block, const MTPD //if (msg.has_entities()) msg.ventities.c_vector().v.size() QString text(textClean(qs(msg.vmessage))); initTime(); - initMedia(msg.vmedia, text); + initMedia(msg.has_media() ? (&msg.vmedia) : 0, text); setText(text, msg.has_entities() ? linksFromMTP(msg.ventities.c_vector().v) : LinksInText()); } -HistoryMessage::HistoryMessage(History *history, HistoryBlock *block, MsgId msgId, int32 flags, QDateTime date, int32 from, const QString &msg, const LinksInText &links, const MTPMessageMedia &media) : +HistoryMessage::HistoryMessage(History *history, HistoryBlock *block, MsgId msgId, int32 flags, QDateTime date, int32 from, const QString &msg, const LinksInText &links, const MTPMessageMedia *media) : HistoryItem(history, block, msgId, flags, date, from) , _text(st::msgMinWidth) , _textWidth(0) @@ -5085,53 +5231,53 @@ void HistoryMessage::initTime() { _timeWidth = st::msgDateFont->m.width(_time); } -void HistoryMessage::initMedia(const MTPMessageMedia &media, QString ¤tText) { - switch (media.type()) { +void HistoryMessage::initMedia(const MTPMessageMedia *media, QString ¤tText) { + switch (media ? media->type() : mtpc_messageMediaEmpty) { case mtpc_messageMediaContact: { - const MTPDmessageMediaContact &d(media.c_messageMediaContact()); + const MTPDmessageMediaContact &d(media->c_messageMediaContact()); _media = new HistoryContact(d.vuser_id.v, qs(d.vfirst_name), qs(d.vlast_name), qs(d.vphone_number)); } break; case mtpc_messageMediaGeo: { - const MTPGeoPoint &point(media.c_messageMediaGeo().vgeo); + const MTPGeoPoint &point(media->c_messageMediaGeo().vgeo); if (point.type() == mtpc_geoPoint) { const MTPDgeoPoint &d(point.c_geoPoint()); _media = new HistoryImageLink(qsl("location:%1,%2").arg(d.vlat.v).arg(d.vlong.v)); } } break; case mtpc_messageMediaVenue: { - const MTPDmessageMediaVenue &d(media.c_messageMediaVenue()); + const MTPDmessageMediaVenue &d(media->c_messageMediaVenue()); if (d.vgeo.type() == mtpc_geoPoint) { const MTPDgeoPoint &g(d.vgeo.c_geoPoint()); _media = new HistoryImageLink(qsl("location:%1,%2").arg(g.vlat.v).arg(g.vlong.v), qs(d.vtitle), qs(d.vaddress)); } } break; case mtpc_messageMediaPhoto: { - const MTPDmessageMediaPhoto &photo(media.c_messageMediaPhoto()); + const MTPDmessageMediaPhoto &photo(media->c_messageMediaPhoto()); if (photo.vphoto.type() == mtpc_photo) { _media = new HistoryPhoto(photo.vphoto.c_photo(), qs(photo.vcaption), this); } } break; case mtpc_messageMediaVideo: { - const MTPDmessageMediaVideo &video(media.c_messageMediaVideo()); + const MTPDmessageMediaVideo &video(media->c_messageMediaVideo()); if (video.vvideo.type() == mtpc_video) { _media = new HistoryVideo(video.vvideo.c_video(), qs(video.vcaption), this); } } break; case mtpc_messageMediaAudio: { - const MTPAudio &audio(media.c_messageMediaAudio().vaudio); + const MTPAudio &audio(media->c_messageMediaAudio().vaudio); if (audio.type() == mtpc_audio) { _media = new HistoryAudio(audio.c_audio()); } } break; case mtpc_messageMediaDocument: { - const MTPDocument &document(media.c_messageMediaDocument().vdocument); + const MTPDocument &document(media->c_messageMediaDocument().vdocument); if (document.type() == mtpc_document) { DocumentData *doc = App::feedDocument(document); return initMediaFromDocument(doc); } } break; case mtpc_messageMediaWebPage: { - const MTPWebPage &d(media.c_messageMediaWebPage().vwebpage); + const MTPWebPage &d(media->c_messageMediaWebPage().vwebpage); switch (d.type()) { case mtpc_webPageEmpty: initMediaFromText(currentText); break; case mtpc_webPagePending: { @@ -5228,8 +5374,8 @@ HistoryMedia *HistoryMessage::getMedia(bool inOverview) const { return _media; } -void HistoryMessage::setMedia(const MTPmessageMedia &media) { - if ((!_media || _media->isImageLink()) && media.type() == mtpc_messageMediaEmpty) return; +void HistoryMessage::setMedia(const MTPMessageMedia *media) { + if ((!_media || _media->isImageLink()) && (!media || media->type() == mtpc_messageMediaEmpty)) return; bool mediaWasDisplayed = false; if (_media) { @@ -5589,7 +5735,7 @@ HistoryMessage::~HistoryMessage() { } } -HistoryForwarded::HistoryForwarded(History *history, HistoryBlock *block, const MTPDmessage &msg) : HistoryMessage(history, block, msg.vid.v, msg.vflags.v, ::date(msg.vdate), msg.vfrom_id.v, textClean(qs(msg.vmessage)), msg.has_entities() ? linksFromMTP(msg.ventities.c_vector().v) : LinksInText(), msg.vmedia) +HistoryForwarded::HistoryForwarded(History *history, HistoryBlock *block, const MTPDmessage &msg) : HistoryMessage(history, block, msg.vid.v, msg.vflags.v, ::date(msg.vdate), msg.vfrom_id.v, textClean(qs(msg.vmessage)), msg.has_entities() ? linksFromMTP(msg.ventities.c_vector().v) : LinksInText(), msg.has_media() ? (&msg.vmedia) : 0) , fwdDate(::date(msg.vfwd_date)) , fwdFrom(App::user(msg.vfwd_from_id.v)) , fwdFromVersion(fwdFrom->nameVersion) @@ -5785,7 +5931,7 @@ void HistoryForwarded::getSymbol(uint16 &symbol, bool &after, bool &upon, int32 return HistoryMessage::getSymbol(symbol, after, upon, x, y); } -HistoryReply::HistoryReply(History *history, HistoryBlock *block, const MTPDmessage &msg) : HistoryMessage(history, block, msg.vid.v, msg.vflags.v, ::date(msg.vdate), msg.vfrom_id.v, textClean(qs(msg.vmessage)), msg.has_entities() ? linksFromMTP(msg.ventities.c_vector().v) : LinksInText(), msg.vmedia) +HistoryReply::HistoryReply(History *history, HistoryBlock *block, const MTPDmessage &msg) : HistoryMessage(history, block, msg.vid.v, msg.vflags.v, ::date(msg.vdate), msg.vfrom_id.v, textClean(qs(msg.vmessage)), msg.has_entities() ? linksFromMTP(msg.ventities.c_vector().v) : LinksInText(), msg.has_media() ? (&msg.vmedia) : 0) , replyToMsgId(msg.vreply_to_msg_id.v) , replyToMsg(0) , replyToVersion(0) diff --git a/Telegram/SourceFiles/history.h b/Telegram/SourceFiles/history.h index 3f1fe63c6..d4a826a76 100644 --- a/Telegram/SourceFiles/history.h +++ b/Telegram/SourceFiles/history.h @@ -780,7 +780,7 @@ public: virtual HistoryMedia *getMedia(bool inOverview = false) const { return 0; } - virtual void setMedia(const MTPmessageMedia &media) { + virtual void setMedia(const MTPMessageMedia *media) { } virtual void setText(const QString &text, const LinksInText &links) { } @@ -1000,7 +1000,7 @@ private: Text _caption; QString _size; - int32 _thumbw, _thumbx, _thumby; + int32 _thumbw; mutable QString _dldTextCache, _uplTextCache; mutable int32 _dldDone, _uplDone; @@ -1191,14 +1191,16 @@ public: private: WebPageData *data; - TextLinkPtr _openl, _photol; + TextLinkPtr _openl, _attachl; bool _asArticle; Text _title, _description; int32 _siteNameWidth; - QString _duration; - int32 _durationWidth; + QString _duration, _docName, _docSize; + int32 _durationWidth, _docNameWidth, _docThumbWidth; + mutable QString _docDownloadTextCache; + mutable int32 _docDownloadDone; int16 _pixw, _pixh; }; @@ -1289,12 +1291,12 @@ class HistoryMessage : public HistoryItem { public: HistoryMessage(History *history, HistoryBlock *block, const MTPDmessage &msg); - HistoryMessage(History *history, HistoryBlock *block, MsgId msgId, int32 flags, QDateTime date, int32 from, const QString &msg, const LinksInText &links, const MTPMessageMedia &media); + HistoryMessage(History *history, HistoryBlock *block, MsgId msgId, int32 flags, QDateTime date, int32 from, const QString &msg, const LinksInText &links, const MTPMessageMedia *media); HistoryMessage(History *history, HistoryBlock *block, MsgId msgId, int32 flags, QDateTime date, int32 from, const QString &msg, const LinksInText &links, HistoryMedia *media); HistoryMessage(History *history, HistoryBlock *block, MsgId msgId, int32 flags, QDateTime date, int32 from, DocumentData *doc); void initTime(); - void initMedia(const MTPMessageMedia &media, QString ¤tText); + void initMedia(const MTPMessageMedia *media, QString ¤tText); void initMediaFromText(QString ¤tText); void initMediaFromDocument(DocumentData *doc); void initDimensions(const HistoryItem *parent = 0); @@ -1334,7 +1336,7 @@ public: LinksInText textLinks() const; QString inDialogsText() const; HistoryMedia *getMedia(bool inOverview = false) const; - void setMedia(const MTPmessageMedia &media); + void setMedia(const MTPMessageMedia *media); void setText(const QString &text, const LinksInText &links); void getTextWithLinks(QString &text, LinksInText &links); diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 2398b60bf..94b74db1c 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -5114,18 +5114,25 @@ void HistoryWidget::updatePreview() { if (_previewData->title.isEmpty()) { if (_previewData->description.isEmpty()) { title = _previewData->author; - desc = _previewData->url; + desc = ((_previewData->doc && !_previewData->doc->name.isEmpty()) ? _previewData->doc->name : _previewData->url); } else { title = _previewData->description; - desc = _previewData->author.isEmpty() ? _previewData->url : _previewData->author; + desc = _previewData->author.isEmpty() ? ((_previewData->doc && !_previewData->doc->name.isEmpty()) ? _previewData->doc->name : _previewData->url) : _previewData->author; } } else { title = _previewData->title; - desc = _previewData->description.isEmpty() ? (_previewData->author.isEmpty() ? _previewData->url : _previewData->author) : _previewData->description; + desc = _previewData->description.isEmpty() ? (_previewData->author.isEmpty() ? ((_previewData->doc && !_previewData->doc->name.isEmpty()) ? _previewData->doc->name : _previewData->url) : _previewData->author) : _previewData->description; } } else { title = _previewData->siteName; - desc = _previewData->title.isEmpty() ? (_previewData->description.isEmpty() ? (_previewData->author.isEmpty() ? _previewData->url : _previewData->author) : _previewData->description) : _previewData->title; + desc = _previewData->title.isEmpty() ? (_previewData->description.isEmpty() ? (_previewData->author.isEmpty() ? ((_previewData->doc && !_previewData->doc->name.isEmpty()) ? _previewData->doc->name : _previewData->url) : _previewData->author) : _previewData->description) : _previewData->title; + } + if (title.isEmpty()) { + if (_previewData->photo) { + title = lang(lng_attach_photo); + } else if (_previewData->doc) { + title = lang(lng_attach_file); + } } _previewTitle.setText(st::msgServiceNameFont, title, _textNameOptions); _previewDescription.setText(st::msgFont, desc, _textDlgOptions); @@ -5407,8 +5414,8 @@ void HistoryWidget::drawField(Painter &p) { if (drawPreview) { int32 previewLeft = st::replySkip + st::webPageLeft; p.fillRect(st::replySkip, backy + st::msgReplyPadding.top(), st::webPageBar, st::msgReplyBarSize.height(), st::msgInReplyBarColor->b); - if (_previewData->photo && !_previewData->photo->thumb->isNull()) { - ImagePtr replyPreview = _previewData->photo->makeReplyPreview(); + if ((_previewData->photo && !_previewData->photo->thumb->isNull()) || (_previewData->doc && !_previewData->doc->thumb->isNull())) { + ImagePtr replyPreview = _previewData->photo ? _previewData->photo->makeReplyPreview() : _previewData->doc->makeReplyPreview(); if (!replyPreview->isNull()) { QRect to(previewLeft, backy + st::msgReplyPadding.top(), st::msgReplyBarSize.height(), st::msgReplyBarSize.height()); if (replyPreview->width() == replyPreview->height()) { diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 4e30f83c0..55b6d43e6 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -982,9 +982,59 @@ DialogsIndexed &MainWidget::dialogsList() { return dialogs.dialogsList(); } +inline bool replaceCharBySpace(ushort code) { + // \xe2\x80[\xa8 - \xac\xad] // 8232 - 8237 + // QString from1 = QString::fromUtf8("\xe2\x80\xa8"), to1 = QString::fromUtf8("\xe2\x80\xad"); + // \xcc[\xb3\xbf\x8a] // 819, 831, 778 + // QString bad1 = QString::fromUtf8("\xcc\xb3"), bad2 = QString::fromUtf8("\xcc\xbf"), bad3 = QString::fromUtf8("\xcc\x8a"); + // [\x00\x01\x02\x07\x08\x0b-\x1f] // '\t' = 0x09 + return (code >= 0x00 && code <= 0x02) || (code >= 0x07 && code <= 0x09) || (code >= 0x0b && code <= 0x1f) || + (code == 819) || (code == 831) || (code == 778) || (code >= 8232 && code <= 8237); +} + QString cleanMessage(const QString &text) { - QString result = text.trimmed(); - // clean bad symbols + QString result = text; + QChar *_start = result.data(), *_end = _start + result.size(), *start = _start, *end = _end, *ch = start, *copy = 0; + for (; ch != end; ++ch) { + if (ch->unicode() == '\r') { + copy = ch + 1; + break; + } else if (replaceCharBySpace(ch->unicode())) { + *ch = ' '; + } + } + if (copy) { + for (; copy != end; ++copy) { + if (copy->unicode() == '\r') { + continue; + } else if (replaceCharBySpace(copy->unicode())) { + *ch++ = ' '; + } else { + *ch++ = *copy; + } + } + end = ch; + } + + // PHP trim() removes [ \t\n\r\x00\x0b], we have removed [\t\r\x00\x0b] before, so + for (; start != end; ++start) { + if (start->unicode() != ' ' && start->unicode() != '\n') { + break; + } + } + for (QChar *e = end - 1; start != end; end = e) { + if (e->unicode() != ' ' && e->unicode() != '\n') { + break; + } + --e; + } + if (start == end) { + return QString(); + } else if (start > _start) { + return QString(start, end - start); + } else if (end < _end) { + result.resize(end - start); + } return result; } @@ -1017,7 +1067,7 @@ void MainWidget::sendPreparedText(History *hist, const QString &text, MsgId repl } MTPVector localEntities = linksToMTP(textParseLinks(sendingText, itemTextParseOptions(hist, App::self()).flags)); hist->addToBack(MTP_message(MTP_int(flags), MTP_int(newId), MTP_int(MTP::authedId()), App::peerToMTP(hist->peer->id), MTPint(), MTPint(), MTP_int(replyTo), MTP_int(unixtime()), msgText, media, MTPnullMarkup, localEntities)); - hist->sendRequestId = MTP::send(MTPmessages_SendMessage(MTP_int(sendFlags), hist->peer->input, MTP_int(replyTo), msgText, MTP_long(randomId), MTPnullMarkup, localEntities), App::main()->rpcDone(&MainWidget::sentDataReceived, randomId), RPCFailHandlerPtr(), 0, 0, hist->sendRequestId); + hist->sendRequestId = MTP::send(MTPmessages_SendMessage(MTP_int(sendFlags), hist->peer->input, MTP_int(replyTo), msgText, MTP_long(randomId), MTPnullMarkup, localEntities), App::main()->rpcDone(&MainWidget::sentUpdatesReceived, randomId), RPCFailHandlerPtr(), 0, 0, hist->sendRequestId); } finishForwarding(hist); @@ -2232,87 +2282,8 @@ void MainWidget::windowShown() { history.windowShown(); } -void MainWidget::sentDataReceived(uint64 randomId, const MTPmessages_SentMessage &result) { - switch (result.type()) { - case mtpc_messages_sentMessage: { - const MTPDmessages_sentMessage &d(result.c_messages_sentMessage()); - - HistoryItem *item = 0; - if (randomId) { - QString text = App::histSentTextByItem(randomId); - feedUpdate(MTP_updateMessageID(d.vid, MTP_long(randomId))); // ignore real date - LinksInText links(linksFromMTP(d.ventities.c_vector().v)); - if (!text.isEmpty() && !links.isEmpty()) { - item = App::histItemById(d.vid.v); - if (item) { - bool was = item->hasTextLinks(); - item->setText(text, links); - item->initDimensions(0); - itemResized(item); - if (!was && item->hasTextLinks()) { - item->history()->addToOverview(item, OverviewLinks); - } - } - } - } - - if (updInited) { - if (!updPtsUpdated(d.vpts.v, d.vpts_count.v)) { - _byPtsSentMessage.insert(ptsKey(SkippedSentMessage), result); - return; - } - } - - if (!item) { - item = App::histItemById(d.vid.v); - } - if (item) { - item->setMedia(d.vmedia); - } - } break; - - case mtpc_messages_sentMessageLink: { - const MTPDmessages_sentMessageLink &d(result.c_messages_sentMessageLink()); - - HistoryItem *item = 0; - if (randomId) { - //QString text = App::histSentTextByItem(randomId); - feedUpdate(MTP_updateMessageID(d.vid, MTP_long(randomId))); // ignore real date - //LinksInText links(linksFromMTP(d.ventities.c_vector().v)); - //if (!text.isEmpty() && !links.isEmpty()) { - // item = App::histItemById(d.vid.v); - // if (item) { - // bool was = item->hasTextLinks(); - // item->setText(text, links); - // item->initDimensions(0); - // itemResized(item); - // if (!was && item->hasTextLinks()) { - // item->history()->addToOverview(item, OverviewLinks); - // } - // } - //} - } - - if (updInited) { - if (!updPtsUpdated(d.vpts.v, d.vpts_count.v)) { - _byPtsSentMessage.insert(ptsKey(SkippedSentMessage), result); - return; - } - } - App::feedUserLinks(d.vlinks); - - if (!item) { - item = App::histItemById(d.vid.v); - } - if (item) { - item->setMedia(d.vmedia); - } - } break; - }; -} - -void MainWidget::sentUpdatesReceived(const MTPUpdates &result) { - handleUpdates(result); +void MainWidget::sentUpdatesReceived(uint64 randomId, const MTPUpdates &result) { + handleUpdates(result, randomId); App::emitPeerUpdated(); } @@ -2728,7 +2699,7 @@ void MainWidget::applySkippedPtsUpdates() { switch (i.value()) { case SkippedUpdate: feedUpdate(_byPtsUpdate.value(i.key())); break; case SkippedUpdates: handleUpdates(_byPtsUpdates.value(i.key())); break; - case SkippedSentMessage: sentDataReceived(0, _byPtsSentMessage.value(i.key())); break; +// case SkippedSentMessage: sentDataReceived(0, _byPtsSentMessage.value(i.key())); break; } } --updSkipPtsUpdateLevel; @@ -2740,7 +2711,7 @@ void MainWidget::clearSkippedPtsUpdates() { _byPtsQueue.clear(); _byPtsUpdate.clear(); _byPtsUpdates.clear(); - _byPtsSentMessage.clear(); +// _byPtsSentMessage.clear(); updSkipPtsUpdateLevel = 0; } @@ -2999,6 +2970,8 @@ void MainWidget::inviteImportDone(const MTPUpdates &updates) { } break; case mtpc_updateShortChatMessage: { } break; + case mtpc_updateShortSentMessage: { + } break; case mtpc_updatesTooLong: { } break; } @@ -3093,7 +3066,6 @@ void MainWidget::gotNotifySetting(MTPInputNotifyPeer peer, const MTPPeerNotifySe case mtpc_inputNotifyAll: applyNotifySetting(MTP_notifyAll(), settings); break; case mtpc_inputNotifyUsers: applyNotifySetting(MTP_notifyUsers(), settings); break; case mtpc_inputNotifyChats: applyNotifySetting(MTP_notifyChats(), settings); break; - case mtpc_inputNotifyGeoChatPeer: break; // no MTP_peerGeoChat case mtpc_inputNotifyPeer: switch (peer.c_inputNotifyPeer().vpeer.type()) { case mtpc_inputPeerEmpty: applyNotifySetting(MTP_notifyPeer(MTP_peerUser(MTP_int(0))), settings); break; @@ -3352,7 +3324,7 @@ void MainWidget::updateReceived(const mtpPrime *from, const mtpPrime *end) { update(); } -void MainWidget::handleUpdates(const MTPUpdates &updates) { +void MainWidget::handleUpdates(const MTPUpdates &updates, uint64 randomId) { switch (updates.type()) { case mtpc_updates: { const MTPDupdates &d(updates.c_updates()); @@ -3435,6 +3407,41 @@ void MainWidget::handleUpdates(const MTPUpdates &updates) { updSetState(0, d.vdate.v, updQts, updSeq); } break; + case mtpc_updateShortSentMessage: { + const MTPDupdateShortSentMessage &d(updates.c_updateShortSentMessage()); + HistoryItem *item = 0; + if (randomId) { + QString text = d.has_entities() ? App::histSentTextByItem(randomId) : QString(); + feedUpdate(MTP_updateMessageID(d.vid, MTP_long(randomId))); // ignore real date + if (!text.isEmpty()) { + LinksInText links(linksFromMTP(d.ventities.c_vector().v)); + item = App::histItemById(d.vid.v); + if (item && !links.isEmpty()) { + bool was = item->hasTextLinks(); + item->setText(text, links); + item->initDimensions(0); + itemResized(item); + if (!was && item->hasTextLinks()) { + item->history()->addToOverview(item, OverviewLinks); + } + } + } + } + + if (!updPtsUpdated(d.vpts.v, d.vpts_count.v)) { + _byPtsUpdates.insert(ptsKey(SkippedUpdates), updates); + return; + } + if (!item) { + item = App::histItemById(d.vid.v); + } + if (item) { + item->setMedia(d.has_media() ? (&d.vmedia) : 0); + } + + updSetState(0, d.vdate.v, updQts, updSeq); + } break; + case mtpc_updatesTooLong: { MTP_LOG(0, ("getDifference { good - updatesTooLong received }%1").arg(cTestMode() ? " TESTMODE" : "")); return getDifference(); @@ -3686,10 +3693,6 @@ void MainWidget::feedUpdate(const MTPUpdate &update) { } } break; - case mtpc_updateNewGeoChatMessage: { - const MTPDupdateNewGeoChatMessage &d(update.c_updateNewGeoChatMessage()); - } break; - case mtpc_updateNewEncryptedMessage: { const MTPDupdateNewEncryptedMessage &d(update.c_updateNewEncryptedMessage()); } break; diff --git a/Telegram/SourceFiles/mainwidget.h b/Telegram/SourceFiles/mainwidget.h index 73491c1c4..8279caf12 100644 --- a/Telegram/SourceFiles/mainwidget.h +++ b/Telegram/SourceFiles/mainwidget.h @@ -222,8 +222,10 @@ public: void windowShown(); - void sentDataReceived(uint64 randomId, const MTPmessages_SentMessage &data); - void sentUpdatesReceived(const MTPUpdates &updates); + void sentUpdatesReceived(uint64 randomId, const MTPUpdates &updates); + void sentUpdatesReceived(const MTPUpdates &updates) { + return sentUpdatesReceived(0, updates); + } void msgUpdated(PeerId peer, const HistoryItem *msg); void historyToDown(History *hist); void dialogsToUp(); @@ -478,7 +480,7 @@ private: void feedUpdate(const MTPUpdate &update); void updateReceived(const mtpPrime *from, const mtpPrime *end); - void handleUpdates(const MTPUpdates &updates); + void handleUpdates(const MTPUpdates &updates, uint64 randomId = 0); bool updateFail(const RPCError &e); void usernameResolveDone(QPair toProfileStartToken, const MTPUser &result); @@ -544,7 +546,7 @@ private: enum PtsSkippedQueue { SkippedUpdate, SkippedUpdates, - SkippedSentMessage, +// SkippedSentMessage, SkippedStatedMessage, SkippedStatedMessages }; @@ -555,7 +557,7 @@ private: QMap _byPtsQueue; QMap _byPtsUpdate; QMap _byPtsUpdates; - QMap _byPtsSentMessage; +// QMap _byPtsSentMessage; SingleTimer _byPtsTimer; QMap _bySeqUpdates; diff --git a/Telegram/SourceFiles/mtproto/mtpConnection.cpp b/Telegram/SourceFiles/mtproto/mtpConnection.cpp index 1a8e0b0f8..58b0e7745 100644 --- a/Telegram/SourceFiles/mtproto/mtpConnection.cpp +++ b/Telegram/SourceFiles/mtproto/mtpConnection.cpp @@ -2812,7 +2812,7 @@ int32 MTProtoConnectionPrivate::handleOneReceived(const mtpPrime *from, const mt mtpRequestId fakeRequestId = sessionData->nextFakeRequestId(); haveReceived.insert(fakeRequestId, mtpResponse(update)); // notify main process about new updates - if (cons != mtpc_updatesTooLong && cons != mtpc_updateShortMessage && cons != mtpc_updateShortChatMessage && cons != mtpc_updateShort && cons != mtpc_updatesCombined && cons != mtpc_updates) { + if (cons != mtpc_updatesTooLong && cons != mtpc_updateShortMessage && cons != mtpc_updateShortChatMessage && cons != mtpc_updateShortSentMessage && cons != mtpc_updateShort && cons != mtpc_updatesCombined && cons != mtpc_updates) { LOG(("Message Error: unknown constructor %1").arg(cons)); // maybe new api?.. } diff --git a/Telegram/SourceFiles/mtproto/mtpCoreTypes.h b/Telegram/SourceFiles/mtproto/mtpCoreTypes.h index e9e479134..682073f14 100644 --- a/Telegram/SourceFiles/mtproto/mtpCoreTypes.h +++ b/Telegram/SourceFiles/mtproto/mtpCoreTypes.h @@ -366,7 +366,7 @@ static const mtpTypeId mtpLayers[] = { mtpc_invokeWithLayer17, mtpc_invokeWithLayer18, }, mtpLayerMaxSingle = sizeof(mtpLayers) / sizeof(mtpLayers[0]); -static const mtpPrime mtpCurrentLayer = 34; +static const mtpPrime mtpCurrentLayer = 36; template class MTPBoxed : public bareT { diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.cpp b/Telegram/SourceFiles/mtproto/mtpScheme.cpp index 48cf2b3f0..d6bd9b55d 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.cpp +++ b/Telegram/SourceFiles/mtproto/mtpScheme.cpp @@ -655,7 +655,8 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP case 1: to.add(" duration: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 2: to.add(" w: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 3: to.add(" h: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" caption: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 4: to.add(" mime_type: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" caption: "); ++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; } break; @@ -673,7 +674,8 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP case 2: to.add(" duration: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 3: to.add(" w: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; case 4: to.add(" h: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: to.add(" caption: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 5: to.add(" mime_type: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; + case 6: to.add(" caption: "); ++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; } break; @@ -1213,29 +1215,6 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP } break; - case mtpc_geoChat: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ geoChat"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" 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(" access_hash: "); ++stages.back(); types.push_back(mtpc_long); 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(" address: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: to.add(" venue: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 5: to.add(" geo: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 6: to.add(" photo: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 7: 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 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(" checked_in: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 10: 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; - } - break; - case mtpc_chatFull: if (stage) { to.add(",\n").addSpaces(lev); @@ -1346,7 +1325,7 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP 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(); types.push_back(0); 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; @@ -1566,24 +1545,6 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP } break; - case mtpc_messageActionGeoChatCreate: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ messageActionGeoChatCreate"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: 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(" address: "); ++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; - } - break; - - case mtpc_messageActionGeoChatCheckin: - to.add("{ messageActionGeoChatCheckin }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); - break; - case mtpc_messageActionChatJoinedByLink: if (stage) { to.add(",\n").addSpaces(lev); @@ -1840,19 +1801,6 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP to.add("{ inputNotifyAll }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - case mtpc_inputNotifyGeoChatPeer: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ inputNotifyGeoChatPeer"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } - break; - case mtpc_inputPeerNotifyEventsEmpty: to.add("{ inputPeerNotifyEventsEmpty }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; @@ -2025,20 +1973,6 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP } break; - case mtpc_chatLocated: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ chatLocated"); - 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(" distance: "); ++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; - } - break; - case mtpc_contacts_link: if (stage) { to.add(",\n").addSpaces(lev); @@ -2194,43 +2128,6 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP } break; - case mtpc_messages_sentMessage: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ messages_sentMessage"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" 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(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" media: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" entities: "); ++stages.back(); types.push_back(00); 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; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } - break; - - case mtpc_messages_sentMessageLink: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ messages_sentMessageLink"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" 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(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" media: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" pts: "); ++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_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(" links: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 6: to.add(" seq: "); ++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; - } - break; - case mtpc_messages_chats: if (stage) { to.add(",\n").addSpaces(lev); @@ -2487,19 +2384,6 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP } break; - case mtpc_updateNewGeoChatMessage: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ updateNewGeoChatMessage"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" message: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } - break; - case mtpc_updateNewEncryptedMessage: if (stage) { to.add(",\n").addSpaces(lev); @@ -2899,6 +2783,25 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP } break; + case mtpc_updateShortSentMessage: + if (stage) { + to.add(",\n").addSpaces(lev); + } else { + to.add("{ updateShortSentMessage"); + to.add("\n").addSpaces(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(" 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; + default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; + } + break; + case mtpc_photos_photos: if (stage) { to.add(",\n").addSpaces(lev); @@ -3051,132 +2954,6 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP } break; - case mtpc_inputGeoChat: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ inputGeoChat"); - 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(" access_hash: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } - break; - - case mtpc_geoChatMessageEmpty: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ geoChatMessageEmpty"); - 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(" 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; - } - break; - - case mtpc_geoChatMessage: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ geoChatMessage"); - 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(" 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(" date: "); ++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(" media: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } - break; - - case mtpc_geoChatMessageService: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ geoChatMessageService"); - 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(" 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(" date: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 4: 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; - } - break; - - case mtpc_geochats_statedMessage: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ geochats_statedMessage"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" message: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" chats: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" users: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: to.add(" seq: "); ++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; - } - break; - - case mtpc_geochats_located: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ geochats_located"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" results: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" messages: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" chats: "); ++stages.back(); types.push_back(00); 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; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } - break; - - case mtpc_geochats_messages: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ geochats_messages"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" messages: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" chats: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: 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; - } - break; - - case mtpc_geochats_messagesSlice: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ geochats_messagesSlice"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" count: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" messages: "); ++stages.back(); types.push_back(00); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" chats: "); ++stages.back(); types.push_back(00); 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; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } - break; - case mtpc_encryptedChatEmpty: if (stage) { to.add(",\n").addSpaces(lev); @@ -4025,6 +3802,7 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP case 12: to.add(" embed_height: "); ++stages.back(); if (flag & MTPDwebPage::flag_embed_height) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 6 IN FIELD flags ]"); } break; case 13: to.add(" duration: "); ++stages.back(); if (flag & MTPDwebPage::flag_duration) { types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 7 IN FIELD flags ]"); } break; case 14: to.add(" author: "); ++stages.back(); if (flag & MTPDwebPage::flag_author) { types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); } else { to.add("[ SKIPPED BY BIT 8 IN FIELD flags ]"); } break; + case 15: to.add(" document: "); ++stages.back(); if (flag & MTPDwebPage::flag_document) { 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; default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; } break; @@ -4863,20 +4641,6 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP } break; - case mtpc_geochats_setTyping: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ geochats_setTyping"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" typing: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } - break; - case mtpc_messages_discardEncryption: if (stage) { to.add(",\n").addSpaces(lev); @@ -5785,19 +5549,6 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP } break; - case mtpc_geochats_getFullChat: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ geochats_getFullChat"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } - break; - case mtpc_updates_getState: to.add("{ updates_getState }"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; @@ -5941,159 +5692,6 @@ void mtpTextSerializeType(MTPStringLogger &to, const mtpPrime *&from, const mtpP } break; - case mtpc_geochats_getLocated: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ geochats_getLocated"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" geo_point: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" radius: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: 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; - } - break; - - case mtpc_geochats_getRecents: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ geochats_getRecents"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: 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; - } - break; - - case mtpc_geochats_search: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ geochats_search"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" q: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" filter: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 3: 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 4: 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 5: to.add(" offset: "); ++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_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(" 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; - } - break; - - case mtpc_geochats_getHistory: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ geochats_getHistory"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" offset: "); ++stages.back(); types.push_back(mtpc_int); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: 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 3: 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; - } - break; - - case mtpc_geochats_checkin: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ geochats_checkin"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } - break; - - case mtpc_geochats_editChatTitle: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ geochats_editChatTitle"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - 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(" address: "); ++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; - } - break; - - case mtpc_geochats_editChatPhoto: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ geochats_editChatPhoto"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" photo: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } - break; - - case mtpc_geochats_sendMessage: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ geochats_sendMessage"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" message: "); ++stages.back(); types.push_back(mtpc_string); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" random_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } - break; - - case mtpc_geochats_sendMedia: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ geochats_sendMedia"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: to.add(" peer: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 1: to.add(" media: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" random_id: "); ++stages.back(); types.push_back(mtpc_long); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - default: to.add("}"); types.pop_back(); vtypes.pop_back(); stages.pop_back(); flags.pop_back(); break; - } - break; - - case mtpc_geochats_createGeoChat: - if (stage) { - to.add(",\n").addSpaces(lev); - } else { - to.add("{ geochats_createGeoChat"); - to.add("\n").addSpaces(lev); - } - switch (stage) { - case 0: 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(" geo_point: "); ++stages.back(); types.push_back(0); vtypes.push_back(0); stages.push_back(0); flags.push_back(0); break; - case 2: to.add(" 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(" venue: "); ++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; - } - break; - case mtpc_messages_getDhConfig: if (stage) { to.add(",\n").addSpaces(lev); diff --git a/Telegram/SourceFiles/mtproto/mtpScheme.h b/Telegram/SourceFiles/mtproto/mtpScheme.h index 6ee83d88c..82b548bb1 100644 --- a/Telegram/SourceFiles/mtproto/mtpScheme.h +++ b/Telegram/SourceFiles/mtproto/mtpScheme.h @@ -77,8 +77,8 @@ enum { mtpc_inputMediaPhoto = 0xe9bfb4f3, mtpc_inputMediaGeoPoint = 0xf9c44144, mtpc_inputMediaContact = 0xa6e45987, - mtpc_inputMediaUploadedVideo = 0xe13fd4bc, - mtpc_inputMediaUploadedThumbVideo = 0x96fb97dc, + mtpc_inputMediaUploadedVideo = 0x82713fdf, + mtpc_inputMediaUploadedThumbVideo = 0x7780ddf9, mtpc_inputMediaVideo = 0x936a4ebd, mtpc_inputChatPhotoEmpty = 0x1ca48f57, mtpc_inputChatUploadedPhoto = 0x94254732, @@ -124,7 +124,7 @@ enum { mtpc_chatPhotoEmpty = 0x37c1011c, mtpc_chatPhoto = 0x6153276a, mtpc_messageEmpty = 0x83e5de54, - mtpc_message = 0xf07814c8, + mtpc_message = 0x2bebfa86, mtpc_messageService = 0x1d86f70e, mtpc_messageMediaEmpty = 0x3ded6320, mtpc_messageMediaPhoto = 0x3d8ce53d, @@ -171,7 +171,6 @@ enum { mtpc_contactBlocked = 0x561bc879, mtpc_contactSuggested = 0x3de191a1, mtpc_contactStatus = 0xd3680c61, - mtpc_chatLocated = 0x3631cf4c, mtpc_contacts_link = 0x3ace484c, mtpc_contacts_contactsNotModified = 0xb74ba9d2, mtpc_contacts_contacts = 0x6f8b8cb2, @@ -183,7 +182,6 @@ enum { mtpc_messages_dialogsSlice = 0x71e094f3, mtpc_messages_messages = 0x8c718e87, mtpc_messages_messagesSlice = 0xb446ae3, - mtpc_messages_sentMessage = 0x8a99d8e0, mtpc_messages_chats = 0x64ff9fd5, mtpc_messages_chatFull = 0xe5d7d19c, mtpc_messages_affectedHistory = 0xb45c69d1, @@ -228,20 +226,6 @@ enum { mtpc_help_appUpdate = 0x8987f311, mtpc_help_noAppUpdate = 0xc45a6536, mtpc_help_inviteText = 0x18cb9f78, - mtpc_messages_sentMessageLink = 0x35a1a663, - mtpc_inputGeoChat = 0x74d456fa, - mtpc_inputNotifyGeoChatPeer = 0x4d8ddec8, - mtpc_geoChat = 0x75eaea5a, - mtpc_geoChatMessageEmpty = 0x60311a9b, - mtpc_geoChatMessage = 0x4505f8e1, - mtpc_geoChatMessageService = 0xd34fa24e, - mtpc_geochats_statedMessage = 0x17b1578b, - mtpc_geochats_located = 0x48feb267, - mtpc_geochats_messages = 0xd1526db1, - mtpc_geochats_messagesSlice = 0xbc5863e8, - mtpc_messageActionGeoChatCreate = 0x6f038ebc, - mtpc_messageActionGeoChatCheckin = 0xc7d53de, - mtpc_updateNewGeoChatMessage = 0x5a68e3f7, mtpc_wallPaperSolid = 0x63117f24, mtpc_updateNewEncryptedMessage = 0x12bcbd9a, mtpc_updateEncryptedChatTyping = 0x1710f156, @@ -352,7 +336,7 @@ enum { mtpc_updateWebPage = 0x2cc36971, mtpc_webPageEmpty = 0xeb1477e8, mtpc_webPagePending = 0xc586da1c, - mtpc_webPage = 0xa31ea0b5, + mtpc_webPage = 0xca820ed7, mtpc_messageMediaWebPage = 0xa32dd600, mtpc_authorization = 0x7bf2e6f6, mtpc_account_authorizations = 0x1250abde, @@ -399,6 +383,7 @@ enum { mtpc_messageEntityCode = 0x28a20571, mtpc_messageEntityPre = 0x73924be0, mtpc_messageEntityTextUrl = 0x76a6d327, + mtpc_updateShortSentMessage = 0x11f1331c, mtpc_invokeAfterMsg = 0xcb9f372d, mtpc_invokeAfterMsgs = 0x3dc4b4f0, mtpc_auth_checkPhone = 0x6fe51dfb, @@ -442,7 +427,7 @@ enum { mtpc_messages_deleteMessages = 0xa5f18925, mtpc_messages_receivedMessages = 0x5a954c0, mtpc_messages_setTyping = 0xa3825e50, - mtpc_messages_sendMessage = 0xdf12390, + mtpc_messages_sendMessage = 0xfa88427a, mtpc_messages_sendMedia = 0xc8f16791, mtpc_messages_forwardMessages = 0x55e1728d, mtpc_messages_getChats = 0x3c6aa187, @@ -467,18 +452,6 @@ enum { mtpc_photos_getUserPhotos = 0x91cd32a8, mtpc_messages_forwardMessage = 0x33963bf9, mtpc_messages_sendBroadcast = 0xbf73f4da, - mtpc_geochats_getLocated = 0x7f192d8f, - mtpc_geochats_getRecents = 0xe1427e6f, - mtpc_geochats_checkin = 0x55b3e8fb, - mtpc_geochats_getFullChat = 0x6722dd6f, - mtpc_geochats_editChatTitle = 0x4c8e2273, - mtpc_geochats_editChatPhoto = 0x35d81a95, - mtpc_geochats_search = 0xcfcdc44d, - mtpc_geochats_getHistory = 0xb53f7a68, - mtpc_geochats_setTyping = 0x8b8a729, - mtpc_geochats_sendMessage = 0x61b0044, - mtpc_geochats_sendMedia = 0xb8f0deff, - mtpc_geochats_createGeoChat = 0xe092e16, mtpc_messages_getDhConfig = 0x26cf8950, mtpc_messages_requestEncryption = 0xf64daf43, mtpc_messages_acceptEncryption = 0x3dbc0415, @@ -685,7 +658,6 @@ class MTPchat; class MTPDchatEmpty; class MTPDchat; class MTPDchatForbidden; -class MTPDgeoChat; class MTPchatFull; class MTPDchatFull; @@ -721,7 +693,6 @@ class MTPDmessageActionChatEditTitle; class MTPDmessageActionChatEditPhoto; class MTPDmessageActionChatAddUser; class MTPDmessageActionChatDeleteUser; -class MTPDmessageActionGeoChatCreate; class MTPDmessageActionChatJoinedByLink; class MTPdialog; @@ -758,7 +729,6 @@ class MTPDauth_exportedAuthorization; class MTPinputNotifyPeer; class MTPDinputNotifyPeer; -class MTPDinputNotifyGeoChatPeer; class MTPinputPeerNotifyEvents; @@ -792,9 +762,6 @@ class MTPDcontactSuggested; class MTPcontactStatus; class MTPDcontactStatus; -class MTPchatLocated; -class MTPDchatLocated; - class MTPcontacts_link; class MTPDcontacts_link; @@ -819,10 +786,6 @@ class MTPmessages_messages; class MTPDmessages_messages; class MTPDmessages_messagesSlice; -class MTPmessages_sentMessage; -class MTPDmessages_sentMessage; -class MTPDmessages_sentMessageLink; - class MTPmessages_chats; class MTPDmessages_chats; @@ -847,7 +810,6 @@ class MTPDupdateUserPhoto; class MTPDupdateContactRegistered; class MTPDupdateContactLink; class MTPDupdateNewAuthorization; -class MTPDupdateNewGeoChatMessage; class MTPDupdateNewEncryptedMessage; class MTPDupdateEncryptedChatTyping; class MTPDupdateEncryption; @@ -879,6 +841,7 @@ class MTPDupdateShortChatMessage; class MTPDupdateShort; class MTPDupdatesCombined; class MTPDupdates; +class MTPDupdateShortSentMessage; class MTPphotos_photos; class MTPDphotos_photos; @@ -905,24 +868,6 @@ class MTPDhelp_appUpdate; class MTPhelp_inviteText; class MTPDhelp_inviteText; -class MTPinputGeoChat; -class MTPDinputGeoChat; - -class MTPgeoChatMessage; -class MTPDgeoChatMessageEmpty; -class MTPDgeoChatMessage; -class MTPDgeoChatMessageService; - -class MTPgeochats_statedMessage; -class MTPDgeochats_statedMessage; - -class MTPgeochats_located; -class MTPDgeochats_located; - -class MTPgeochats_messages; -class MTPDgeochats_messages; -class MTPDgeochats_messagesSlice; - class MTPencryptedChat; class MTPDencryptedChatEmpty; class MTPDencryptedChatWaiting; @@ -1179,7 +1124,6 @@ typedef MTPBoxed MTPImportedContact; typedef MTPBoxed MTPContactBlocked; typedef MTPBoxed MTPContactSuggested; typedef MTPBoxed MTPContactStatus; -typedef MTPBoxed MTPChatLocated; typedef MTPBoxed MTPcontacts_Link; typedef MTPBoxed MTPcontacts_Contacts; typedef MTPBoxed MTPcontacts_ImportedContacts; @@ -1187,7 +1131,6 @@ typedef MTPBoxed MTPcontacts_Blocked; typedef MTPBoxed MTPcontacts_Suggested; typedef MTPBoxed MTPmessages_Dialogs; typedef MTPBoxed MTPmessages_Messages; -typedef MTPBoxed MTPmessages_SentMessage; typedef MTPBoxed MTPmessages_Chats; typedef MTPBoxed MTPmessages_ChatFull; typedef MTPBoxed MTPmessages_AffectedHistory; @@ -1204,11 +1147,6 @@ typedef MTPBoxed MTPConfig; typedef MTPBoxed MTPNearestDc; typedef MTPBoxed MTPhelp_AppUpdate; typedef MTPBoxed MTPhelp_InviteText; -typedef MTPBoxed MTPInputGeoChat; -typedef MTPBoxed MTPGeoChatMessage; -typedef MTPBoxed MTPgeochats_StatedMessage; -typedef MTPBoxed MTPgeochats_Located; -typedef MTPBoxed MTPgeochats_Messages; typedef MTPBoxed MTPEncryptedChat; typedef MTPBoxed MTPInputEncryptedChat; typedef MTPBoxed MTPEncryptedFile; @@ -2453,8 +2391,8 @@ private: friend MTPinputMedia MTP_inputMediaPhoto(const MTPInputPhoto &_id, const MTPstring &_caption); friend MTPinputMedia MTP_inputMediaGeoPoint(const MTPInputGeoPoint &_geo_point); friend MTPinputMedia MTP_inputMediaContact(const MTPstring &_phone_number, const MTPstring &_first_name, const MTPstring &_last_name); - friend MTPinputMedia MTP_inputMediaUploadedVideo(const MTPInputFile &_file, MTPint _duration, MTPint _w, MTPint _h, const MTPstring &_caption); - friend MTPinputMedia MTP_inputMediaUploadedThumbVideo(const MTPInputFile &_file, const MTPInputFile &_thumb, MTPint _duration, MTPint _w, MTPint _h, const MTPstring &_caption); + friend MTPinputMedia MTP_inputMediaUploadedVideo(const MTPInputFile &_file, MTPint _duration, MTPint _w, MTPint _h, const MTPstring &_mime_type, const MTPstring &_caption); + friend MTPinputMedia MTP_inputMediaUploadedThumbVideo(const MTPInputFile &_file, const MTPInputFile &_thumb, MTPint _duration, MTPint _w, MTPint _h, const MTPstring &_mime_type, const MTPstring &_caption); friend MTPinputMedia MTP_inputMediaVideo(const MTPInputVideo &_id, const MTPstring &_caption); friend MTPinputMedia MTP_inputMediaUploadedAudio(const MTPInputFile &_file, MTPint _duration, const MTPstring &_mime_type); friend MTPinputMedia MTP_inputMediaAudio(const MTPInputAudio &_id); @@ -3118,18 +3056,6 @@ public: return *(const MTPDchatForbidden*)data; } - MTPDgeoChat &_geoChat() { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_geoChat) throw mtpErrorWrongTypeId(_type, mtpc_geoChat); - split(); - return *(MTPDgeoChat*)data; - } - const MTPDgeoChat &c_geoChat() const { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_geoChat) throw mtpErrorWrongTypeId(_type, mtpc_geoChat); - return *(const MTPDgeoChat*)data; - } - uint32 innerLength() const; mtpTypeId type() const; void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons); @@ -3142,12 +3068,10 @@ private: explicit MTPchat(MTPDchatEmpty *_data); explicit MTPchat(MTPDchat *_data); explicit MTPchat(MTPDchatForbidden *_data); - explicit MTPchat(MTPDgeoChat *_data); friend MTPchat MTP_chatEmpty(MTPint _id); friend MTPchat MTP_chat(MTPint _id, const MTPstring &_title, const MTPChatPhoto &_photo, MTPint _participants_count, MTPint _date, MTPBool _left, MTPint _version); friend MTPchat MTP_chatForbidden(MTPint _id, const MTPstring &_title, MTPint _date); - friend MTPchat MTP_geoChat(MTPint _id, const MTPlong &_access_hash, const MTPstring &_title, const MTPstring &_address, const MTPstring &_venue, const MTPGeoPoint &_geo, const MTPChatPhoto &_photo, MTPint _participants_count, MTPint _date, MTPBool _checked_in, MTPint _version); mtpTypeId _type; }; @@ -3574,18 +3498,6 @@ public: return *(const MTPDmessageActionChatDeleteUser*)data; } - MTPDmessageActionGeoChatCreate &_messageActionGeoChatCreate() { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_messageActionGeoChatCreate) throw mtpErrorWrongTypeId(_type, mtpc_messageActionGeoChatCreate); - split(); - return *(MTPDmessageActionGeoChatCreate*)data; - } - const MTPDmessageActionGeoChatCreate &c_messageActionGeoChatCreate() const { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_messageActionGeoChatCreate) throw mtpErrorWrongTypeId(_type, mtpc_messageActionGeoChatCreate); - return *(const MTPDmessageActionGeoChatCreate*)data; - } - MTPDmessageActionChatJoinedByLink &_messageActionChatJoinedByLink() { if (!data) throw mtpErrorUninitialized(); if (_type != mtpc_messageActionChatJoinedByLink) throw mtpErrorWrongTypeId(_type, mtpc_messageActionChatJoinedByLink); @@ -3612,7 +3524,6 @@ private: explicit MTPmessageAction(MTPDmessageActionChatEditPhoto *_data); explicit MTPmessageAction(MTPDmessageActionChatAddUser *_data); explicit MTPmessageAction(MTPDmessageActionChatDeleteUser *_data); - explicit MTPmessageAction(MTPDmessageActionGeoChatCreate *_data); explicit MTPmessageAction(MTPDmessageActionChatJoinedByLink *_data); friend MTPmessageAction MTP_messageActionEmpty(); @@ -3622,8 +3533,6 @@ private: friend MTPmessageAction MTP_messageActionChatDeletePhoto(); friend MTPmessageAction MTP_messageActionChatAddUser(MTPint _user_id); friend MTPmessageAction MTP_messageActionChatDeleteUser(MTPint _user_id); - friend MTPmessageAction MTP_messageActionGeoChatCreate(const MTPstring &_title, const MTPstring &_address); - friend MTPmessageAction MTP_messageActionGeoChatCheckin(); friend MTPmessageAction MTP_messageActionChatJoinedByLink(MTPint _inviter_id); mtpTypeId _type; @@ -4030,18 +3939,6 @@ public: return *(const MTPDinputNotifyPeer*)data; } - MTPDinputNotifyGeoChatPeer &_inputNotifyGeoChatPeer() { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_inputNotifyGeoChatPeer) throw mtpErrorWrongTypeId(_type, mtpc_inputNotifyGeoChatPeer); - split(); - return *(MTPDinputNotifyGeoChatPeer*)data; - } - const MTPDinputNotifyGeoChatPeer &c_inputNotifyGeoChatPeer() const { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_inputNotifyGeoChatPeer) throw mtpErrorWrongTypeId(_type, mtpc_inputNotifyGeoChatPeer); - return *(const MTPDinputNotifyGeoChatPeer*)data; - } - uint32 innerLength() const; mtpTypeId type() const; void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons); @@ -4052,13 +3949,11 @@ public: private: explicit MTPinputNotifyPeer(mtpTypeId type); explicit MTPinputNotifyPeer(MTPDinputNotifyPeer *_data); - explicit MTPinputNotifyPeer(MTPDinputNotifyGeoChatPeer *_data); friend MTPinputNotifyPeer MTP_inputNotifyPeer(const MTPInputPeer &_peer); friend MTPinputNotifyPeer MTP_inputNotifyUsers(); friend MTPinputNotifyPeer MTP_inputNotifyChats(); friend MTPinputNotifyPeer MTP_inputNotifyAll(); - friend MTPinputNotifyPeer MTP_inputNotifyGeoChatPeer(const MTPInputGeoChat &_peer); mtpTypeId _type; }; @@ -4420,37 +4315,6 @@ private: }; typedef MTPBoxed MTPContactStatus; -class MTPchatLocated : private mtpDataOwner { -public: - MTPchatLocated(); - MTPchatLocated(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_chatLocated) : mtpDataOwner(0) { - read(from, end, cons); - } - - MTPDchatLocated &_chatLocated() { - if (!data) throw mtpErrorUninitialized(); - split(); - return *(MTPDchatLocated*)data; - } - const MTPDchatLocated &c_chatLocated() const { - if (!data) throw mtpErrorUninitialized(); - return *(const MTPDchatLocated*)data; - } - - uint32 innerLength() const; - mtpTypeId type() const; - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_chatLocated); - void write(mtpBuffer &to) const; - - typedef void ResponseType; - -private: - explicit MTPchatLocated(MTPDchatLocated *_data); - - friend MTPchatLocated MTP_chatLocated(MTPint _chat_id, MTPint _distance); -}; -typedef MTPBoxed MTPChatLocated; - class MTPcontacts_link : private mtpDataOwner { public: MTPcontacts_link(); @@ -4735,57 +4599,6 @@ private: }; typedef MTPBoxed MTPmessages_Messages; -class MTPmessages_sentMessage : private mtpDataOwner { -public: - MTPmessages_sentMessage() : mtpDataOwner(0), _type(0) { - } - MTPmessages_sentMessage(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) : mtpDataOwner(0), _type(0) { - read(from, end, cons); - } - - MTPDmessages_sentMessage &_messages_sentMessage() { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_messages_sentMessage) throw mtpErrorWrongTypeId(_type, mtpc_messages_sentMessage); - split(); - return *(MTPDmessages_sentMessage*)data; - } - const MTPDmessages_sentMessage &c_messages_sentMessage() const { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_messages_sentMessage) throw mtpErrorWrongTypeId(_type, mtpc_messages_sentMessage); - return *(const MTPDmessages_sentMessage*)data; - } - - MTPDmessages_sentMessageLink &_messages_sentMessageLink() { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_messages_sentMessageLink) throw mtpErrorWrongTypeId(_type, mtpc_messages_sentMessageLink); - split(); - return *(MTPDmessages_sentMessageLink*)data; - } - const MTPDmessages_sentMessageLink &c_messages_sentMessageLink() const { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_messages_sentMessageLink) throw mtpErrorWrongTypeId(_type, mtpc_messages_sentMessageLink); - return *(const MTPDmessages_sentMessageLink*)data; - } - - 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 MTPmessages_sentMessage(mtpTypeId type); - explicit MTPmessages_sentMessage(MTPDmessages_sentMessage *_data); - explicit MTPmessages_sentMessage(MTPDmessages_sentMessageLink *_data); - - friend MTPmessages_sentMessage MTP_messages_sentMessage(MTPint _id, MTPint _date, const MTPMessageMedia &_media, const MTPVector &_entities, MTPint _pts, MTPint _pts_count); - friend MTPmessages_sentMessage MTP_messages_sentMessageLink(MTPint _id, MTPint _date, const MTPMessageMedia &_media, MTPint _pts, MTPint _pts_count, const MTPVector &_links, MTPint _seq); - - mtpTypeId _type; -}; -typedef MTPBoxed MTPmessages_SentMessage; - class MTPmessages_chats : private mtpDataOwner { public: MTPmessages_chats(); @@ -5063,18 +4876,6 @@ public: return *(const MTPDupdateNewAuthorization*)data; } - MTPDupdateNewGeoChatMessage &_updateNewGeoChatMessage() { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_updateNewGeoChatMessage) throw mtpErrorWrongTypeId(_type, mtpc_updateNewGeoChatMessage); - split(); - return *(MTPDupdateNewGeoChatMessage*)data; - } - const MTPDupdateNewGeoChatMessage &c_updateNewGeoChatMessage() const { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_updateNewGeoChatMessage) throw mtpErrorWrongTypeId(_type, mtpc_updateNewGeoChatMessage); - return *(const MTPDupdateNewGeoChatMessage*)data; - } - MTPDupdateNewEncryptedMessage &_updateNewEncryptedMessage() { if (!data) throw mtpErrorUninitialized(); if (_type != mtpc_updateNewEncryptedMessage) throw mtpErrorWrongTypeId(_type, mtpc_updateNewEncryptedMessage); @@ -5288,7 +5089,6 @@ private: explicit MTPupdate(MTPDupdateContactRegistered *_data); explicit MTPupdate(MTPDupdateContactLink *_data); explicit MTPupdate(MTPDupdateNewAuthorization *_data); - explicit MTPupdate(MTPDupdateNewGeoChatMessage *_data); explicit MTPupdate(MTPDupdateNewEncryptedMessage *_data); explicit MTPupdate(MTPDupdateEncryptedChatTyping *_data); explicit MTPupdate(MTPDupdateEncryption *_data); @@ -5318,7 +5118,6 @@ private: friend MTPupdate MTP_updateContactRegistered(MTPint _user_id, MTPint _date); friend MTPupdate MTP_updateContactLink(MTPint _user_id, const MTPContactLink &_my_link, const MTPContactLink &_foreign_link); friend MTPupdate MTP_updateNewAuthorization(const MTPlong &_auth_key_id, MTPint _date, const MTPstring &_device, const MTPstring &_location); - friend MTPupdate MTP_updateNewGeoChatMessage(const MTPGeoChatMessage &_message); friend MTPupdate MTP_updateNewEncryptedMessage(const MTPEncryptedMessage &_message, MTPint _qts); friend MTPupdate MTP_updateEncryptedChatTyping(MTPint _chat_id); friend MTPupdate MTP_updateEncryption(const MTPEncryptedChat &_chat, MTPint _date); @@ -5504,6 +5303,18 @@ public: return *(const MTPDupdates*)data; } + MTPDupdateShortSentMessage &_updateShortSentMessage() { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_updateShortSentMessage) throw mtpErrorWrongTypeId(_type, mtpc_updateShortSentMessage); + split(); + return *(MTPDupdateShortSentMessage*)data; + } + const MTPDupdateShortSentMessage &c_updateShortSentMessage() const { + if (!data) throw mtpErrorUninitialized(); + if (_type != mtpc_updateShortSentMessage) throw mtpErrorWrongTypeId(_type, mtpc_updateShortSentMessage); + return *(const MTPDupdateShortSentMessage*)data; + } + uint32 innerLength() const; mtpTypeId type() const; void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons); @@ -5518,6 +5329,7 @@ private: explicit MTPupdates(MTPDupdateShort *_data); explicit MTPupdates(MTPDupdatesCombined *_data); explicit MTPupdates(MTPDupdates *_data); + explicit MTPupdates(MTPDupdateShortSentMessage *_data); friend MTPupdates MTP_updatesTooLong(); friend MTPupdates MTP_updateShortMessage(MTPint _flags, MTPint _id, MTPint _user_id, const MTPstring &_message, MTPint _pts, MTPint _pts_count, MTPint _date, MTPint _fwd_from_id, MTPint _fwd_date, MTPint _reply_to_msg_id, const MTPVector &_entities); @@ -5525,6 +5337,7 @@ private: friend MTPupdates MTP_updateShort(const MTPUpdate &_update, MTPint _date); friend MTPupdates MTP_updatesCombined(const MTPVector &_updates, const MTPVector &_users, const MTPVector &_chats, MTPint _date, MTPint _seq_start, MTPint _seq); friend MTPupdates MTP_updates(const MTPVector &_updates, const MTPVector &_users, const MTPVector &_chats, MTPint _date, MTPint _seq); + friend MTPupdates MTP_updateShortSentMessage(MTPint _flags, MTPint _id, MTPint _pts, MTPint _pts_count, MTPint _date, const MTPMessageMedia &_media, const MTPVector &_entities); mtpTypeId _type; }; @@ -5805,215 +5618,6 @@ private: }; typedef MTPBoxed MTPhelp_InviteText; -class MTPinputGeoChat : private mtpDataOwner { -public: - MTPinputGeoChat(); - MTPinputGeoChat(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_inputGeoChat) : mtpDataOwner(0) { - read(from, end, cons); - } - - MTPDinputGeoChat &_inputGeoChat() { - if (!data) throw mtpErrorUninitialized(); - split(); - return *(MTPDinputGeoChat*)data; - } - const MTPDinputGeoChat &c_inputGeoChat() const { - if (!data) throw mtpErrorUninitialized(); - return *(const MTPDinputGeoChat*)data; - } - - uint32 innerLength() const; - mtpTypeId type() const; - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_inputGeoChat); - void write(mtpBuffer &to) const; - - typedef void ResponseType; - -private: - explicit MTPinputGeoChat(MTPDinputGeoChat *_data); - - friend MTPinputGeoChat MTP_inputGeoChat(MTPint _chat_id, const MTPlong &_access_hash); -}; -typedef MTPBoxed MTPInputGeoChat; - -class MTPgeoChatMessage : private mtpDataOwner { -public: - MTPgeoChatMessage() : mtpDataOwner(0), _type(0) { - } - MTPgeoChatMessage(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) : mtpDataOwner(0), _type(0) { - read(from, end, cons); - } - - MTPDgeoChatMessageEmpty &_geoChatMessageEmpty() { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_geoChatMessageEmpty) throw mtpErrorWrongTypeId(_type, mtpc_geoChatMessageEmpty); - split(); - return *(MTPDgeoChatMessageEmpty*)data; - } - const MTPDgeoChatMessageEmpty &c_geoChatMessageEmpty() const { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_geoChatMessageEmpty) throw mtpErrorWrongTypeId(_type, mtpc_geoChatMessageEmpty); - return *(const MTPDgeoChatMessageEmpty*)data; - } - - MTPDgeoChatMessage &_geoChatMessage() { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_geoChatMessage) throw mtpErrorWrongTypeId(_type, mtpc_geoChatMessage); - split(); - return *(MTPDgeoChatMessage*)data; - } - const MTPDgeoChatMessage &c_geoChatMessage() const { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_geoChatMessage) throw mtpErrorWrongTypeId(_type, mtpc_geoChatMessage); - return *(const MTPDgeoChatMessage*)data; - } - - MTPDgeoChatMessageService &_geoChatMessageService() { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_geoChatMessageService) throw mtpErrorWrongTypeId(_type, mtpc_geoChatMessageService); - split(); - return *(MTPDgeoChatMessageService*)data; - } - const MTPDgeoChatMessageService &c_geoChatMessageService() const { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_geoChatMessageService) throw mtpErrorWrongTypeId(_type, mtpc_geoChatMessageService); - return *(const MTPDgeoChatMessageService*)data; - } - - 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 MTPgeoChatMessage(mtpTypeId type); - explicit MTPgeoChatMessage(MTPDgeoChatMessageEmpty *_data); - explicit MTPgeoChatMessage(MTPDgeoChatMessage *_data); - explicit MTPgeoChatMessage(MTPDgeoChatMessageService *_data); - - friend MTPgeoChatMessage MTP_geoChatMessageEmpty(MTPint _chat_id, MTPint _id); - friend MTPgeoChatMessage MTP_geoChatMessage(MTPint _chat_id, MTPint _id, MTPint _from_id, MTPint _date, const MTPstring &_message, const MTPMessageMedia &_media); - friend MTPgeoChatMessage MTP_geoChatMessageService(MTPint _chat_id, MTPint _id, MTPint _from_id, MTPint _date, const MTPMessageAction &_action); - - mtpTypeId _type; -}; -typedef MTPBoxed MTPGeoChatMessage; - -class MTPgeochats_statedMessage : private mtpDataOwner { -public: - MTPgeochats_statedMessage(); - MTPgeochats_statedMessage(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_statedMessage) : mtpDataOwner(0) { - read(from, end, cons); - } - - MTPDgeochats_statedMessage &_geochats_statedMessage() { - if (!data) throw mtpErrorUninitialized(); - split(); - return *(MTPDgeochats_statedMessage*)data; - } - const MTPDgeochats_statedMessage &c_geochats_statedMessage() const { - if (!data) throw mtpErrorUninitialized(); - return *(const MTPDgeochats_statedMessage*)data; - } - - uint32 innerLength() const; - mtpTypeId type() const; - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_statedMessage); - void write(mtpBuffer &to) const; - - typedef void ResponseType; - -private: - explicit MTPgeochats_statedMessage(MTPDgeochats_statedMessage *_data); - - friend MTPgeochats_statedMessage MTP_geochats_statedMessage(const MTPGeoChatMessage &_message, const MTPVector &_chats, const MTPVector &_users, MTPint _seq); -}; -typedef MTPBoxed MTPgeochats_StatedMessage; - -class MTPgeochats_located : private mtpDataOwner { -public: - MTPgeochats_located(); - MTPgeochats_located(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_located) : mtpDataOwner(0) { - read(from, end, cons); - } - - MTPDgeochats_located &_geochats_located() { - if (!data) throw mtpErrorUninitialized(); - split(); - return *(MTPDgeochats_located*)data; - } - const MTPDgeochats_located &c_geochats_located() const { - if (!data) throw mtpErrorUninitialized(); - return *(const MTPDgeochats_located*)data; - } - - uint32 innerLength() const; - mtpTypeId type() const; - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_located); - void write(mtpBuffer &to) const; - - typedef void ResponseType; - -private: - explicit MTPgeochats_located(MTPDgeochats_located *_data); - - friend MTPgeochats_located MTP_geochats_located(const MTPVector &_results, const MTPVector &_messages, const MTPVector &_chats, const MTPVector &_users); -}; -typedef MTPBoxed MTPgeochats_Located; - -class MTPgeochats_messages : private mtpDataOwner { -public: - MTPgeochats_messages() : mtpDataOwner(0), _type(0) { - } - MTPgeochats_messages(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) : mtpDataOwner(0), _type(0) { - read(from, end, cons); - } - - MTPDgeochats_messages &_geochats_messages() { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_geochats_messages) throw mtpErrorWrongTypeId(_type, mtpc_geochats_messages); - split(); - return *(MTPDgeochats_messages*)data; - } - const MTPDgeochats_messages &c_geochats_messages() const { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_geochats_messages) throw mtpErrorWrongTypeId(_type, mtpc_geochats_messages); - return *(const MTPDgeochats_messages*)data; - } - - MTPDgeochats_messagesSlice &_geochats_messagesSlice() { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_geochats_messagesSlice) throw mtpErrorWrongTypeId(_type, mtpc_geochats_messagesSlice); - split(); - return *(MTPDgeochats_messagesSlice*)data; - } - const MTPDgeochats_messagesSlice &c_geochats_messagesSlice() const { - if (!data) throw mtpErrorUninitialized(); - if (_type != mtpc_geochats_messagesSlice) throw mtpErrorWrongTypeId(_type, mtpc_geochats_messagesSlice); - return *(const MTPDgeochats_messagesSlice*)data; - } - - 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 MTPgeochats_messages(mtpTypeId type); - explicit MTPgeochats_messages(MTPDgeochats_messages *_data); - explicit MTPgeochats_messages(MTPDgeochats_messagesSlice *_data); - - friend MTPgeochats_messages MTP_geochats_messages(const MTPVector &_messages, const MTPVector &_chats, const MTPVector &_users); - friend MTPgeochats_messages MTP_geochats_messagesSlice(MTPint _count, const MTPVector &_messages, const MTPVector &_chats, const MTPVector &_users); - - mtpTypeId _type; -}; -typedef MTPBoxed MTPgeochats_Messages; - class MTPencryptedChat : private mtpDataOwner { public: MTPencryptedChat() : mtpDataOwner(0), _type(0) { @@ -7385,7 +6989,7 @@ private: friend MTPwebPage MTP_webPageEmpty(const MTPlong &_id); friend MTPwebPage MTP_webPagePending(const MTPlong &_id, MTPint _date); - friend MTPwebPage MTP_webPage(MTPint _flags, const MTPlong &_id, const MTPstring &_url, const MTPstring &_display_url, const MTPstring &_type, const MTPstring &_site_name, const MTPstring &_title, const MTPstring &_description, const MTPPhoto &_photo, const MTPstring &_embed_url, const MTPstring &_embed_type, MTPint _embed_width, MTPint _embed_height, MTPint _duration, const MTPstring &_author); + friend MTPwebPage MTP_webPage(MTPint _flags, const MTPlong &_id, const MTPstring &_url, const MTPstring &_display_url, const MTPstring &_type, const MTPstring &_site_name, const MTPstring &_title, const MTPstring &_description, const MTPPhoto &_photo, const MTPstring &_embed_url, const MTPstring &_embed_type, MTPint _embed_width, MTPint _embed_height, MTPint _duration, const MTPstring &_author, const MTPDocument &_document); mtpTypeId _type; }; @@ -8693,13 +8297,14 @@ class MTPDinputMediaUploadedVideo : public mtpDataImpl { -public: - MTPDgeoChat() { - } - MTPDgeoChat(MTPint _id, const MTPlong &_access_hash, const MTPstring &_title, const MTPstring &_address, const MTPstring &_venue, const MTPGeoPoint &_geo, const MTPChatPhoto &_photo, MTPint _participants_count, MTPint _date, MTPBool _checked_in, MTPint _version) : vid(_id), vaccess_hash(_access_hash), vtitle(_title), vaddress(_address), vvenue(_venue), vgeo(_geo), vphoto(_photo), vparticipants_count(_participants_count), vdate(_date), vchecked_in(_checked_in), vversion(_version) { - } - - MTPint vid; - MTPlong vaccess_hash; - MTPstring vtitle; - MTPstring vaddress; - MTPstring vvenue; - MTPGeoPoint vgeo; - MTPChatPhoto vphoto; - MTPint vparticipants_count; - MTPint vdate; - MTPBool vchecked_in; - MTPint vversion; -}; - class MTPDchatFull : public mtpDataImpl { public: MTPDchatFull() { @@ -9215,6 +8801,7 @@ public: flag_fwd_from_id = (1 << 2), flag_fwd_date = (1 << 2), flag_reply_to_msg_id = (1 << 3), + flag_media = (1 << 9), flag_reply_markup = (1 << 6), flag_entities = (1 << 7), }; @@ -9222,6 +8809,7 @@ public: 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; } + bool has_media() const { return vflags.v & flag_media; } bool has_reply_markup() const { return vflags.v & flag_reply_markup; } bool has_entities() const { return vflags.v & flag_entities; } }; @@ -9381,17 +8969,6 @@ public: MTPint vuser_id; }; -class MTPDmessageActionGeoChatCreate : public mtpDataImpl { -public: - MTPDmessageActionGeoChatCreate() { - } - MTPDmessageActionGeoChatCreate(const MTPstring &_title, const MTPstring &_address) : vtitle(_title), vaddress(_address) { - } - - MTPstring vtitle; - MTPstring vaddress; -}; - class MTPDmessageActionChatJoinedByLink : public mtpDataImpl { public: MTPDmessageActionChatJoinedByLink() { @@ -9584,16 +9161,6 @@ public: MTPInputPeer vpeer; }; -class MTPDinputNotifyGeoChatPeer : public mtpDataImpl { -public: - MTPDinputNotifyGeoChatPeer() { - } - MTPDinputNotifyGeoChatPeer(const MTPInputGeoChat &_peer) : vpeer(_peer) { - } - - MTPInputGeoChat vpeer; -}; - class MTPDinputPeerNotifySettings : public mtpDataImpl { public: MTPDinputPeerNotifySettings() { @@ -9716,17 +9283,6 @@ public: MTPUserStatus vstatus; }; -class MTPDchatLocated : public mtpDataImpl { -public: - MTPDchatLocated() { - } - MTPDchatLocated(MTPint _chat_id, MTPint _distance) : vchat_id(_chat_id), vdistance(_distance) { - } - - MTPint vchat_id; - MTPint vdistance; -}; - class MTPDcontacts_link : public mtpDataImpl { public: MTPDcontacts_link() { @@ -9848,37 +9404,6 @@ public: MTPVector vusers; }; -class MTPDmessages_sentMessage : public mtpDataImpl { -public: - MTPDmessages_sentMessage() { - } - MTPDmessages_sentMessage(MTPint _id, MTPint _date, const MTPMessageMedia &_media, const MTPVector &_entities, MTPint _pts, MTPint _pts_count) : vid(_id), vdate(_date), vmedia(_media), ventities(_entities), vpts(_pts), vpts_count(_pts_count) { - } - - MTPint vid; - MTPint vdate; - MTPMessageMedia vmedia; - MTPVector ventities; - MTPint vpts; - MTPint vpts_count; -}; - -class MTPDmessages_sentMessageLink : public mtpDataImpl { -public: - MTPDmessages_sentMessageLink() { - } - MTPDmessages_sentMessageLink(MTPint _id, MTPint _date, const MTPMessageMedia &_media, MTPint _pts, MTPint _pts_count, const MTPVector &_links, MTPint _seq) : vid(_id), vdate(_date), vmedia(_media), vpts(_pts), vpts_count(_pts_count), vlinks(_links), vseq(_seq) { - } - - MTPint vid; - MTPint vdate; - MTPMessageMedia vmedia; - MTPint vpts; - MTPint vpts_count; - MTPVector vlinks; - MTPint vseq; -}; - class MTPDmessages_chats : public mtpDataImpl { public: MTPDmessages_chats() { @@ -10054,16 +9579,6 @@ public: MTPstring vlocation; }; -class MTPDupdateNewGeoChatMessage : public mtpDataImpl { -public: - MTPDupdateNewGeoChatMessage() { - } - MTPDupdateNewGeoChatMessage(const MTPGeoChatMessage &_message) : vmessage(_message) { - } - - MTPGeoChatMessage vmessage; -}; - class MTPDupdateNewEncryptedMessage : public mtpDataImpl { public: MTPDupdateNewEncryptedMessage() { @@ -10408,6 +9923,30 @@ public: MTPint vseq; }; +class MTPDupdateShortSentMessage : public mtpDataImpl { +public: + MTPDupdateShortSentMessage() { + } + MTPDupdateShortSentMessage(MTPint _flags, MTPint _id, MTPint _pts, MTPint _pts_count, MTPint _date, const MTPMessageMedia &_media, const MTPVector &_entities) : vflags(_flags), vid(_id), vpts(_pts), vpts_count(_pts_count), vdate(_date), vmedia(_media), ventities(_entities) { + } + + MTPint vflags; + MTPint vid; + MTPint vpts; + MTPint vpts_count; + MTPint vdate; + MTPMessageMedia vmedia; + MTPVector ventities; + + enum { + flag_media = (1 << 9), + flag_entities = (1 << 7), + }; + + bool has_media() const { return vflags.v & flag_media; } + bool has_entities() const { return vflags.v & flag_entities; } +}; + class MTPDphotos_photos : public mtpDataImpl { public: MTPDphotos_photos() { @@ -10529,108 +10068,6 @@ public: MTPstring vmessage; }; -class MTPDinputGeoChat : public mtpDataImpl { -public: - MTPDinputGeoChat() { - } - MTPDinputGeoChat(MTPint _chat_id, const MTPlong &_access_hash) : vchat_id(_chat_id), vaccess_hash(_access_hash) { - } - - MTPint vchat_id; - MTPlong vaccess_hash; -}; - -class MTPDgeoChatMessageEmpty : public mtpDataImpl { -public: - MTPDgeoChatMessageEmpty() { - } - MTPDgeoChatMessageEmpty(MTPint _chat_id, MTPint _id) : vchat_id(_chat_id), vid(_id) { - } - - MTPint vchat_id; - MTPint vid; -}; - -class MTPDgeoChatMessage : public mtpDataImpl { -public: - MTPDgeoChatMessage() { - } - MTPDgeoChatMessage(MTPint _chat_id, MTPint _id, MTPint _from_id, MTPint _date, const MTPstring &_message, const MTPMessageMedia &_media) : vchat_id(_chat_id), vid(_id), vfrom_id(_from_id), vdate(_date), vmessage(_message), vmedia(_media) { - } - - MTPint vchat_id; - MTPint vid; - MTPint vfrom_id; - MTPint vdate; - MTPstring vmessage; - MTPMessageMedia vmedia; -}; - -class MTPDgeoChatMessageService : public mtpDataImpl { -public: - MTPDgeoChatMessageService() { - } - MTPDgeoChatMessageService(MTPint _chat_id, MTPint _id, MTPint _from_id, MTPint _date, const MTPMessageAction &_action) : vchat_id(_chat_id), vid(_id), vfrom_id(_from_id), vdate(_date), vaction(_action) { - } - - MTPint vchat_id; - MTPint vid; - MTPint vfrom_id; - MTPint vdate; - MTPMessageAction vaction; -}; - -class MTPDgeochats_statedMessage : public mtpDataImpl { -public: - MTPDgeochats_statedMessage() { - } - MTPDgeochats_statedMessage(const MTPGeoChatMessage &_message, const MTPVector &_chats, const MTPVector &_users, MTPint _seq) : vmessage(_message), vchats(_chats), vusers(_users), vseq(_seq) { - } - - MTPGeoChatMessage vmessage; - MTPVector vchats; - MTPVector vusers; - MTPint vseq; -}; - -class MTPDgeochats_located : public mtpDataImpl { -public: - MTPDgeochats_located() { - } - MTPDgeochats_located(const MTPVector &_results, const MTPVector &_messages, const MTPVector &_chats, const MTPVector &_users) : vresults(_results), vmessages(_messages), vchats(_chats), vusers(_users) { - } - - MTPVector vresults; - MTPVector vmessages; - MTPVector vchats; - MTPVector vusers; -}; - -class MTPDgeochats_messages : public mtpDataImpl { -public: - MTPDgeochats_messages() { - } - MTPDgeochats_messages(const MTPVector &_messages, const MTPVector &_chats, const MTPVector &_users) : vmessages(_messages), vchats(_chats), vusers(_users) { - } - - MTPVector vmessages; - MTPVector vchats; - MTPVector vusers; -}; - -class MTPDgeochats_messagesSlice : public mtpDataImpl { -public: - MTPDgeochats_messagesSlice() { - } - MTPDgeochats_messagesSlice(MTPint _count, const MTPVector &_messages, const MTPVector &_chats, const MTPVector &_users) : vcount(_count), vmessages(_messages), vchats(_chats), vusers(_users) { - } - - MTPint vcount; - MTPVector vmessages; - MTPVector vchats; - MTPVector vusers; -}; - class MTPDencryptedChatEmpty : public mtpDataImpl { public: MTPDencryptedChatEmpty() { @@ -11193,7 +10630,7 @@ class MTPDwebPage : public mtpDataImpl { public: MTPDwebPage() { } - MTPDwebPage(MTPint _flags, const MTPlong &_id, const MTPstring &_url, const MTPstring &_display_url, const MTPstring &_type, const MTPstring &_site_name, const MTPstring &_title, const MTPstring &_description, const MTPPhoto &_photo, const MTPstring &_embed_url, const MTPstring &_embed_type, MTPint _embed_width, MTPint _embed_height, MTPint _duration, const MTPstring &_author) : vflags(_flags), vid(_id), vurl(_url), vdisplay_url(_display_url), vtype(_type), vsite_name(_site_name), vtitle(_title), vdescription(_description), vphoto(_photo), vembed_url(_embed_url), vembed_type(_embed_type), vembed_width(_embed_width), vembed_height(_embed_height), vduration(_duration), vauthor(_author) { + MTPDwebPage(MTPint _flags, const MTPlong &_id, const MTPstring &_url, const MTPstring &_display_url, const MTPstring &_type, const MTPstring &_site_name, const MTPstring &_title, const MTPstring &_description, const MTPPhoto &_photo, const MTPstring &_embed_url, const MTPstring &_embed_type, MTPint _embed_width, MTPint _embed_height, MTPint _duration, const MTPstring &_author, const MTPDocument &_document) : vflags(_flags), vid(_id), vurl(_url), vdisplay_url(_display_url), vtype(_type), vsite_name(_site_name), vtitle(_title), vdescription(_description), vphoto(_photo), vembed_url(_embed_url), vembed_type(_embed_type), vembed_width(_embed_width), vembed_height(_embed_height), vduration(_duration), vauthor(_author), vdocument(_document) { } MTPint vflags; @@ -11211,6 +10648,7 @@ public: MTPint vembed_height; MTPint vduration; MTPstring vauthor; + MTPDocument vdocument; enum { flag_type = (1 << 0), @@ -11224,6 +10662,7 @@ public: flag_embed_height = (1 << 6), flag_duration = (1 << 7), flag_author = (1 << 8), + flag_document = (1 << 9), }; bool has_type() const { return vflags.v & flag_type; } @@ -11237,6 +10676,7 @@ public: bool has_embed_height() const { return vflags.v & flag_embed_height; } bool has_duration() const { return vflags.v & flag_duration; } bool has_author() const { return vflags.v & flag_author; } + bool has_document() const { return vflags.v & flag_document; } }; class MTPDauthorization : public mtpDataImpl { @@ -13847,7 +13287,7 @@ public: if (has_entities()) ventities.write(to); } - typedef MTPmessages_SentMessage ResponseType; + typedef MTPUpdates ResponseType; }; class MTPmessages_SendMessage : public MTPBoxed { public: @@ -14883,546 +14323,6 @@ public: } }; -class MTPgeochats_getLocated { // RPC method 'geochats.getLocated' -public: - MTPInputGeoPoint vgeo_point; - MTPint vradius; - MTPint vlimit; - - MTPgeochats_getLocated() { - } - MTPgeochats_getLocated(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_getLocated) { - read(from, end, cons); - } - MTPgeochats_getLocated(const MTPInputGeoPoint &_geo_point, MTPint _radius, MTPint _limit) : vgeo_point(_geo_point), vradius(_radius), vlimit(_limit) { - } - - uint32 innerLength() const { - return vgeo_point.innerLength() + vradius.innerLength() + vlimit.innerLength(); - } - mtpTypeId type() const { - return mtpc_geochats_getLocated; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_getLocated) { - vgeo_point.read(from, end); - vradius.read(from, end); - vlimit.read(from, end); - } - void write(mtpBuffer &to) const { - vgeo_point.write(to); - vradius.write(to); - vlimit.write(to); - } - - typedef MTPgeochats_Located ResponseType; -}; -class MTPgeochats_GetLocated : public MTPBoxed { -public: - MTPgeochats_GetLocated() { - } - MTPgeochats_GetLocated(const MTPgeochats_getLocated &v) : MTPBoxed(v) { - } - MTPgeochats_GetLocated(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPgeochats_GetLocated(const MTPInputGeoPoint &_geo_point, MTPint _radius, MTPint _limit) : MTPBoxed(MTPgeochats_getLocated(_geo_point, _radius, _limit)) { - } -}; - -class MTPgeochats_getRecents { // RPC method 'geochats.getRecents' -public: - MTPint voffset; - MTPint vlimit; - - MTPgeochats_getRecents() { - } - MTPgeochats_getRecents(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_getRecents) { - read(from, end, cons); - } - MTPgeochats_getRecents(MTPint _offset, MTPint _limit) : voffset(_offset), vlimit(_limit) { - } - - uint32 innerLength() const { - return voffset.innerLength() + vlimit.innerLength(); - } - mtpTypeId type() const { - return mtpc_geochats_getRecents; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_getRecents) { - voffset.read(from, end); - vlimit.read(from, end); - } - void write(mtpBuffer &to) const { - voffset.write(to); - vlimit.write(to); - } - - typedef MTPgeochats_Messages ResponseType; -}; -class MTPgeochats_GetRecents : public MTPBoxed { -public: - MTPgeochats_GetRecents() { - } - MTPgeochats_GetRecents(const MTPgeochats_getRecents &v) : MTPBoxed(v) { - } - MTPgeochats_GetRecents(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPgeochats_GetRecents(MTPint _offset, MTPint _limit) : MTPBoxed(MTPgeochats_getRecents(_offset, _limit)) { - } -}; - -class MTPgeochats_checkin { // RPC method 'geochats.checkin' -public: - MTPInputGeoChat vpeer; - - MTPgeochats_checkin() { - } - MTPgeochats_checkin(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_checkin) { - read(from, end, cons); - } - MTPgeochats_checkin(const MTPInputGeoChat &_peer) : vpeer(_peer) { - } - - uint32 innerLength() const { - return vpeer.innerLength(); - } - mtpTypeId type() const { - return mtpc_geochats_checkin; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_checkin) { - vpeer.read(from, end); - } - void write(mtpBuffer &to) const { - vpeer.write(to); - } - - typedef MTPgeochats_StatedMessage ResponseType; -}; -class MTPgeochats_Checkin : public MTPBoxed { -public: - MTPgeochats_Checkin() { - } - MTPgeochats_Checkin(const MTPgeochats_checkin &v) : MTPBoxed(v) { - } - MTPgeochats_Checkin(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPgeochats_Checkin(const MTPInputGeoChat &_peer) : MTPBoxed(MTPgeochats_checkin(_peer)) { - } -}; - -class MTPgeochats_getFullChat { // RPC method 'geochats.getFullChat' -public: - MTPInputGeoChat vpeer; - - MTPgeochats_getFullChat() { - } - MTPgeochats_getFullChat(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_getFullChat) { - read(from, end, cons); - } - MTPgeochats_getFullChat(const MTPInputGeoChat &_peer) : vpeer(_peer) { - } - - uint32 innerLength() const { - return vpeer.innerLength(); - } - mtpTypeId type() const { - return mtpc_geochats_getFullChat; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_getFullChat) { - vpeer.read(from, end); - } - void write(mtpBuffer &to) const { - vpeer.write(to); - } - - typedef MTPmessages_ChatFull ResponseType; -}; -class MTPgeochats_GetFullChat : public MTPBoxed { -public: - MTPgeochats_GetFullChat() { - } - MTPgeochats_GetFullChat(const MTPgeochats_getFullChat &v) : MTPBoxed(v) { - } - MTPgeochats_GetFullChat(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPgeochats_GetFullChat(const MTPInputGeoChat &_peer) : MTPBoxed(MTPgeochats_getFullChat(_peer)) { - } -}; - -class MTPgeochats_editChatTitle { // RPC method 'geochats.editChatTitle' -public: - MTPInputGeoChat vpeer; - MTPstring vtitle; - MTPstring vaddress; - - MTPgeochats_editChatTitle() { - } - MTPgeochats_editChatTitle(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_editChatTitle) { - read(from, end, cons); - } - MTPgeochats_editChatTitle(const MTPInputGeoChat &_peer, const MTPstring &_title, const MTPstring &_address) : vpeer(_peer), vtitle(_title), vaddress(_address) { - } - - uint32 innerLength() const { - return vpeer.innerLength() + vtitle.innerLength() + vaddress.innerLength(); - } - mtpTypeId type() const { - return mtpc_geochats_editChatTitle; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_editChatTitle) { - vpeer.read(from, end); - vtitle.read(from, end); - vaddress.read(from, end); - } - void write(mtpBuffer &to) const { - vpeer.write(to); - vtitle.write(to); - vaddress.write(to); - } - - typedef MTPgeochats_StatedMessage ResponseType; -}; -class MTPgeochats_EditChatTitle : public MTPBoxed { -public: - MTPgeochats_EditChatTitle() { - } - MTPgeochats_EditChatTitle(const MTPgeochats_editChatTitle &v) : MTPBoxed(v) { - } - MTPgeochats_EditChatTitle(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPgeochats_EditChatTitle(const MTPInputGeoChat &_peer, const MTPstring &_title, const MTPstring &_address) : MTPBoxed(MTPgeochats_editChatTitle(_peer, _title, _address)) { - } -}; - -class MTPgeochats_editChatPhoto { // RPC method 'geochats.editChatPhoto' -public: - MTPInputGeoChat vpeer; - MTPInputChatPhoto vphoto; - - MTPgeochats_editChatPhoto() { - } - MTPgeochats_editChatPhoto(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_editChatPhoto) { - read(from, end, cons); - } - MTPgeochats_editChatPhoto(const MTPInputGeoChat &_peer, const MTPInputChatPhoto &_photo) : vpeer(_peer), vphoto(_photo) { - } - - uint32 innerLength() const { - return vpeer.innerLength() + vphoto.innerLength(); - } - mtpTypeId type() const { - return mtpc_geochats_editChatPhoto; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_editChatPhoto) { - vpeer.read(from, end); - vphoto.read(from, end); - } - void write(mtpBuffer &to) const { - vpeer.write(to); - vphoto.write(to); - } - - typedef MTPgeochats_StatedMessage ResponseType; -}; -class MTPgeochats_EditChatPhoto : public MTPBoxed { -public: - MTPgeochats_EditChatPhoto() { - } - MTPgeochats_EditChatPhoto(const MTPgeochats_editChatPhoto &v) : MTPBoxed(v) { - } - MTPgeochats_EditChatPhoto(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPgeochats_EditChatPhoto(const MTPInputGeoChat &_peer, const MTPInputChatPhoto &_photo) : MTPBoxed(MTPgeochats_editChatPhoto(_peer, _photo)) { - } -}; - -class MTPgeochats_search { // RPC method 'geochats.search' -public: - MTPInputGeoChat vpeer; - MTPstring vq; - MTPMessagesFilter vfilter; - MTPint vmin_date; - MTPint vmax_date; - MTPint voffset; - MTPint vmax_id; - MTPint vlimit; - - MTPgeochats_search() { - } - MTPgeochats_search(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_search) { - read(from, end, cons); - } - MTPgeochats_search(const MTPInputGeoChat &_peer, const MTPstring &_q, const MTPMessagesFilter &_filter, MTPint _min_date, MTPint _max_date, MTPint _offset, MTPint _max_id, MTPint _limit) : vpeer(_peer), vq(_q), vfilter(_filter), vmin_date(_min_date), vmax_date(_max_date), voffset(_offset), vmax_id(_max_id), vlimit(_limit) { - } - - uint32 innerLength() const { - return vpeer.innerLength() + vq.innerLength() + vfilter.innerLength() + vmin_date.innerLength() + vmax_date.innerLength() + voffset.innerLength() + vmax_id.innerLength() + vlimit.innerLength(); - } - mtpTypeId type() const { - return mtpc_geochats_search; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_search) { - vpeer.read(from, end); - vq.read(from, end); - vfilter.read(from, end); - vmin_date.read(from, end); - vmax_date.read(from, end); - voffset.read(from, end); - vmax_id.read(from, end); - vlimit.read(from, end); - } - void write(mtpBuffer &to) const { - vpeer.write(to); - vq.write(to); - vfilter.write(to); - vmin_date.write(to); - vmax_date.write(to); - voffset.write(to); - vmax_id.write(to); - vlimit.write(to); - } - - typedef MTPgeochats_Messages ResponseType; -}; -class MTPgeochats_Search : public MTPBoxed { -public: - MTPgeochats_Search() { - } - MTPgeochats_Search(const MTPgeochats_search &v) : MTPBoxed(v) { - } - MTPgeochats_Search(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPgeochats_Search(const MTPInputGeoChat &_peer, const MTPstring &_q, const MTPMessagesFilter &_filter, MTPint _min_date, MTPint _max_date, MTPint _offset, MTPint _max_id, MTPint _limit) : MTPBoxed(MTPgeochats_search(_peer, _q, _filter, _min_date, _max_date, _offset, _max_id, _limit)) { - } -}; - -class MTPgeochats_getHistory { // RPC method 'geochats.getHistory' -public: - MTPInputGeoChat vpeer; - MTPint voffset; - MTPint vmax_id; - MTPint vlimit; - - MTPgeochats_getHistory() { - } - MTPgeochats_getHistory(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_getHistory) { - read(from, end, cons); - } - MTPgeochats_getHistory(const MTPInputGeoChat &_peer, MTPint _offset, MTPint _max_id, MTPint _limit) : vpeer(_peer), voffset(_offset), vmax_id(_max_id), vlimit(_limit) { - } - - uint32 innerLength() const { - return vpeer.innerLength() + voffset.innerLength() + vmax_id.innerLength() + vlimit.innerLength(); - } - mtpTypeId type() const { - return mtpc_geochats_getHistory; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_getHistory) { - vpeer.read(from, end); - voffset.read(from, end); - vmax_id.read(from, end); - vlimit.read(from, end); - } - void write(mtpBuffer &to) const { - vpeer.write(to); - voffset.write(to); - vmax_id.write(to); - vlimit.write(to); - } - - typedef MTPgeochats_Messages ResponseType; -}; -class MTPgeochats_GetHistory : public MTPBoxed { -public: - MTPgeochats_GetHistory() { - } - MTPgeochats_GetHistory(const MTPgeochats_getHistory &v) : MTPBoxed(v) { - } - MTPgeochats_GetHistory(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPgeochats_GetHistory(const MTPInputGeoChat &_peer, MTPint _offset, MTPint _max_id, MTPint _limit) : MTPBoxed(MTPgeochats_getHistory(_peer, _offset, _max_id, _limit)) { - } -}; - -class MTPgeochats_setTyping { // RPC method 'geochats.setTyping' -public: - MTPInputGeoChat vpeer; - MTPBool vtyping; - - MTPgeochats_setTyping() { - } - MTPgeochats_setTyping(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_setTyping) { - read(from, end, cons); - } - MTPgeochats_setTyping(const MTPInputGeoChat &_peer, MTPBool _typing) : vpeer(_peer), vtyping(_typing) { - } - - uint32 innerLength() const { - return vpeer.innerLength() + vtyping.innerLength(); - } - mtpTypeId type() const { - return mtpc_geochats_setTyping; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_setTyping) { - vpeer.read(from, end); - vtyping.read(from, end); - } - void write(mtpBuffer &to) const { - vpeer.write(to); - vtyping.write(to); - } - - typedef MTPBool ResponseType; -}; -class MTPgeochats_SetTyping : public MTPBoxed { -public: - MTPgeochats_SetTyping() { - } - MTPgeochats_SetTyping(const MTPgeochats_setTyping &v) : MTPBoxed(v) { - } - MTPgeochats_SetTyping(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPgeochats_SetTyping(const MTPInputGeoChat &_peer, MTPBool _typing) : MTPBoxed(MTPgeochats_setTyping(_peer, _typing)) { - } -}; - -class MTPgeochats_sendMessage { // RPC method 'geochats.sendMessage' -public: - MTPInputGeoChat vpeer; - MTPstring vmessage; - MTPlong vrandom_id; - - MTPgeochats_sendMessage() { - } - MTPgeochats_sendMessage(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_sendMessage) { - read(from, end, cons); - } - MTPgeochats_sendMessage(const MTPInputGeoChat &_peer, const MTPstring &_message, const MTPlong &_random_id) : vpeer(_peer), vmessage(_message), vrandom_id(_random_id) { - } - - uint32 innerLength() const { - return vpeer.innerLength() + vmessage.innerLength() + vrandom_id.innerLength(); - } - mtpTypeId type() const { - return mtpc_geochats_sendMessage; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_sendMessage) { - vpeer.read(from, end); - vmessage.read(from, end); - vrandom_id.read(from, end); - } - void write(mtpBuffer &to) const { - vpeer.write(to); - vmessage.write(to); - vrandom_id.write(to); - } - - typedef MTPgeochats_StatedMessage ResponseType; -}; -class MTPgeochats_SendMessage : public MTPBoxed { -public: - MTPgeochats_SendMessage() { - } - MTPgeochats_SendMessage(const MTPgeochats_sendMessage &v) : MTPBoxed(v) { - } - MTPgeochats_SendMessage(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPgeochats_SendMessage(const MTPInputGeoChat &_peer, const MTPstring &_message, const MTPlong &_random_id) : MTPBoxed(MTPgeochats_sendMessage(_peer, _message, _random_id)) { - } -}; - -class MTPgeochats_sendMedia { // RPC method 'geochats.sendMedia' -public: - MTPInputGeoChat vpeer; - MTPInputMedia vmedia; - MTPlong vrandom_id; - - MTPgeochats_sendMedia() { - } - MTPgeochats_sendMedia(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_sendMedia) { - read(from, end, cons); - } - MTPgeochats_sendMedia(const MTPInputGeoChat &_peer, const MTPInputMedia &_media, const MTPlong &_random_id) : vpeer(_peer), vmedia(_media), vrandom_id(_random_id) { - } - - uint32 innerLength() const { - return vpeer.innerLength() + vmedia.innerLength() + vrandom_id.innerLength(); - } - mtpTypeId type() const { - return mtpc_geochats_sendMedia; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_sendMedia) { - vpeer.read(from, end); - vmedia.read(from, end); - vrandom_id.read(from, end); - } - void write(mtpBuffer &to) const { - vpeer.write(to); - vmedia.write(to); - vrandom_id.write(to); - } - - typedef MTPgeochats_StatedMessage ResponseType; -}; -class MTPgeochats_SendMedia : public MTPBoxed { -public: - MTPgeochats_SendMedia() { - } - MTPgeochats_SendMedia(const MTPgeochats_sendMedia &v) : MTPBoxed(v) { - } - MTPgeochats_SendMedia(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPgeochats_SendMedia(const MTPInputGeoChat &_peer, const MTPInputMedia &_media, const MTPlong &_random_id) : MTPBoxed(MTPgeochats_sendMedia(_peer, _media, _random_id)) { - } -}; - -class MTPgeochats_createGeoChat { // RPC method 'geochats.createGeoChat' -public: - MTPstring vtitle; - MTPInputGeoPoint vgeo_point; - MTPstring vaddress; - MTPstring vvenue; - - MTPgeochats_createGeoChat() { - } - MTPgeochats_createGeoChat(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_createGeoChat) { - read(from, end, cons); - } - MTPgeochats_createGeoChat(const MTPstring &_title, const MTPInputGeoPoint &_geo_point, const MTPstring &_address, const MTPstring &_venue) : vtitle(_title), vgeo_point(_geo_point), vaddress(_address), vvenue(_venue) { - } - - uint32 innerLength() const { - return vtitle.innerLength() + vgeo_point.innerLength() + vaddress.innerLength() + vvenue.innerLength(); - } - mtpTypeId type() const { - return mtpc_geochats_createGeoChat; - } - void read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = mtpc_geochats_createGeoChat) { - vtitle.read(from, end); - vgeo_point.read(from, end); - vaddress.read(from, end); - vvenue.read(from, end); - } - void write(mtpBuffer &to) const { - vtitle.write(to); - vgeo_point.write(to); - vaddress.write(to); - vvenue.write(to); - } - - typedef MTPgeochats_StatedMessage ResponseType; -}; -class MTPgeochats_CreateGeoChat : public MTPBoxed { -public: - MTPgeochats_CreateGeoChat() { - } - MTPgeochats_CreateGeoChat(const MTPgeochats_createGeoChat &v) : MTPBoxed(v) { - } - MTPgeochats_CreateGeoChat(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons = 0) : MTPBoxed(from, end, cons) { - } - MTPgeochats_CreateGeoChat(const MTPstring &_title, const MTPInputGeoPoint &_geo_point, const MTPstring &_address, const MTPstring &_venue) : MTPBoxed(MTPgeochats_createGeoChat(_title, _geo_point, _address, _venue)) { - } -}; - class MTPmessages_getDhConfig { // RPC method 'messages.getDhConfig' public: MTPint vversion; @@ -18609,11 +17509,11 @@ inline uint32 MTPinputMedia::innerLength() const { } case mtpc_inputMediaUploadedVideo: { const MTPDinputMediaUploadedVideo &v(c_inputMediaUploadedVideo()); - return v.vfile.innerLength() + v.vduration.innerLength() + v.vw.innerLength() + v.vh.innerLength() + v.vcaption.innerLength(); + return v.vfile.innerLength() + v.vduration.innerLength() + v.vw.innerLength() + v.vh.innerLength() + v.vmime_type.innerLength() + v.vcaption.innerLength(); } case mtpc_inputMediaUploadedThumbVideo: { const MTPDinputMediaUploadedThumbVideo &v(c_inputMediaUploadedThumbVideo()); - return v.vfile.innerLength() + v.vthumb.innerLength() + v.vduration.innerLength() + v.vw.innerLength() + v.vh.innerLength() + v.vcaption.innerLength(); + return v.vfile.innerLength() + v.vthumb.innerLength() + v.vduration.innerLength() + v.vw.innerLength() + v.vh.innerLength() + v.vmime_type.innerLength() + v.vcaption.innerLength(); } case mtpc_inputMediaVideo: { const MTPDinputMediaVideo &v(c_inputMediaVideo()); @@ -18685,6 +17585,7 @@ inline void MTPinputMedia::read(const mtpPrime *&from, const mtpPrime *end, mtpT v.vduration.read(from, end); v.vw.read(from, end); v.vh.read(from, end); + v.vmime_type.read(from, end); v.vcaption.read(from, end); } break; case mtpc_inputMediaUploadedThumbVideo: _type = cons; { @@ -18695,6 +17596,7 @@ inline void MTPinputMedia::read(const mtpPrime *&from, const mtpPrime *end, mtpT v.vduration.read(from, end); v.vw.read(from, end); v.vh.read(from, end); + v.vmime_type.read(from, end); v.vcaption.read(from, end); } break; case mtpc_inputMediaVideo: _type = cons; { @@ -18775,6 +17677,7 @@ inline void MTPinputMedia::write(mtpBuffer &to) const { v.vduration.write(to); v.vw.write(to); v.vh.write(to); + v.vmime_type.write(to); v.vcaption.write(to); } break; case mtpc_inputMediaUploadedThumbVideo: { @@ -18784,6 +17687,7 @@ inline void MTPinputMedia::write(mtpBuffer &to) const { v.vduration.write(to); v.vw.write(to); v.vh.write(to); + v.vmime_type.write(to); v.vcaption.write(to); } break; case mtpc_inputMediaVideo: { @@ -18888,11 +17792,11 @@ inline MTPinputMedia MTP_inputMediaGeoPoint(const MTPInputGeoPoint &_geo_point) inline MTPinputMedia MTP_inputMediaContact(const MTPstring &_phone_number, const MTPstring &_first_name, const MTPstring &_last_name) { return MTPinputMedia(new MTPDinputMediaContact(_phone_number, _first_name, _last_name)); } -inline MTPinputMedia MTP_inputMediaUploadedVideo(const MTPInputFile &_file, MTPint _duration, MTPint _w, MTPint _h, const MTPstring &_caption) { - return MTPinputMedia(new MTPDinputMediaUploadedVideo(_file, _duration, _w, _h, _caption)); +inline MTPinputMedia MTP_inputMediaUploadedVideo(const MTPInputFile &_file, MTPint _duration, MTPint _w, MTPint _h, const MTPstring &_mime_type, const MTPstring &_caption) { + return MTPinputMedia(new MTPDinputMediaUploadedVideo(_file, _duration, _w, _h, _mime_type, _caption)); } -inline MTPinputMedia MTP_inputMediaUploadedThumbVideo(const MTPInputFile &_file, const MTPInputFile &_thumb, MTPint _duration, MTPint _w, MTPint _h, const MTPstring &_caption) { - return MTPinputMedia(new MTPDinputMediaUploadedThumbVideo(_file, _thumb, _duration, _w, _h, _caption)); +inline MTPinputMedia MTP_inputMediaUploadedThumbVideo(const MTPInputFile &_file, const MTPInputFile &_thumb, MTPint _duration, MTPint _w, MTPint _h, const MTPstring &_mime_type, const MTPstring &_caption) { + return MTPinputMedia(new MTPDinputMediaUploadedThumbVideo(_file, _thumb, _duration, _w, _h, _mime_type, _caption)); } inline MTPinputMedia MTP_inputMediaVideo(const MTPInputVideo &_id, const MTPstring &_caption) { return MTPinputMedia(new MTPDinputMediaVideo(_id, _caption)); @@ -19798,10 +18702,6 @@ inline uint32 MTPchat::innerLength() const { const MTPDchatForbidden &v(c_chatForbidden()); return v.vid.innerLength() + v.vtitle.innerLength() + v.vdate.innerLength(); } - case mtpc_geoChat: { - const MTPDgeoChat &v(c_geoChat()); - return v.vid.innerLength() + v.vaccess_hash.innerLength() + v.vtitle.innerLength() + v.vaddress.innerLength() + v.vvenue.innerLength() + v.vgeo.innerLength() + v.vphoto.innerLength() + v.vparticipants_count.innerLength() + v.vdate.innerLength() + v.vchecked_in.innerLength() + v.vversion.innerLength(); - } } return 0; } @@ -19835,21 +18735,6 @@ inline void MTPchat::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId v.vtitle.read(from, end); v.vdate.read(from, end); } break; - case mtpc_geoChat: _type = cons; { - if (!data) setData(new MTPDgeoChat()); - MTPDgeoChat &v(_geoChat()); - v.vid.read(from, end); - v.vaccess_hash.read(from, end); - v.vtitle.read(from, end); - v.vaddress.read(from, end); - v.vvenue.read(from, end); - v.vgeo.read(from, end); - v.vphoto.read(from, end); - v.vparticipants_count.read(from, end); - v.vdate.read(from, end); - v.vchecked_in.read(from, end); - v.vversion.read(from, end); - } break; default: throw mtpErrorUnexpected(cons, "MTPchat"); } } @@ -19875,20 +18760,6 @@ inline void MTPchat::write(mtpBuffer &to) const { v.vtitle.write(to); v.vdate.write(to); } break; - case mtpc_geoChat: { - const MTPDgeoChat &v(c_geoChat()); - v.vid.write(to); - v.vaccess_hash.write(to); - v.vtitle.write(to); - v.vaddress.write(to); - v.vvenue.write(to); - v.vgeo.write(to); - v.vphoto.write(to); - v.vparticipants_count.write(to); - v.vdate.write(to); - v.vchecked_in.write(to); - v.vversion.write(to); - } break; } } inline MTPchat::MTPchat(mtpTypeId type) : mtpDataOwner(0), _type(type) { @@ -19896,7 +18767,6 @@ inline MTPchat::MTPchat(mtpTypeId type) : mtpDataOwner(0), _type(type) { case mtpc_chatEmpty: setData(new MTPDchatEmpty()); break; case mtpc_chat: setData(new MTPDchat()); break; case mtpc_chatForbidden: setData(new MTPDchatForbidden()); break; - case mtpc_geoChat: setData(new MTPDgeoChat()); break; default: throw mtpErrorBadTypeId(type, "MTPchat"); } } @@ -19906,8 +18776,6 @@ inline MTPchat::MTPchat(MTPDchat *_data) : mtpDataOwner(_data), _type(mtpc_chat) } inline MTPchat::MTPchat(MTPDchatForbidden *_data) : mtpDataOwner(_data), _type(mtpc_chatForbidden) { } -inline MTPchat::MTPchat(MTPDgeoChat *_data) : mtpDataOwner(_data), _type(mtpc_geoChat) { -} inline MTPchat MTP_chatEmpty(MTPint _id) { return MTPchat(new MTPDchatEmpty(_id)); } @@ -19917,9 +18785,6 @@ inline MTPchat MTP_chat(MTPint _id, const MTPstring &_title, const MTPChatPhoto inline MTPchat MTP_chatForbidden(MTPint _id, const MTPstring &_title, MTPint _date) { return MTPchat(new MTPDchatForbidden(_id, _title, _date)); } -inline MTPchat MTP_geoChat(MTPint _id, const MTPlong &_access_hash, const MTPstring &_title, const MTPstring &_address, const MTPstring &_venue, const MTPGeoPoint &_geo, const MTPChatPhoto &_photo, MTPint _participants_count, MTPint _date, MTPBool _checked_in, MTPint _version) { - return MTPchat(new MTPDgeoChat(_id, _access_hash, _title, _address, _venue, _geo, _photo, _participants_count, _date, _checked_in, _version)); -} inline MTPchatFull::MTPchatFull() : mtpDataOwner(new MTPDchatFull()) { } @@ -20117,7 +18982,7 @@ inline uint32 MTPmessage::innerLength() const { } case mtpc_message: { const MTPDmessage &v(c_message()); - return v.vflags.innerLength() + v.vid.innerLength() + v.vfrom_id.innerLength() + v.vto_id.innerLength() + (v.has_fwd_from_id() ? v.vfwd_from_id.innerLength() : 0) + (v.has_fwd_date() ? v.vfwd_date.innerLength() : 0) + (v.has_reply_to_msg_id() ? v.vreply_to_msg_id.innerLength() : 0) + v.vdate.innerLength() + v.vmessage.innerLength() + v.vmedia.innerLength() + (v.has_reply_markup() ? v.vreply_markup.innerLength() : 0) + (v.has_entities() ? v.ventities.innerLength() : 0); + return v.vflags.innerLength() + v.vid.innerLength() + v.vfrom_id.innerLength() + v.vto_id.innerLength() + (v.has_fwd_from_id() ? v.vfwd_from_id.innerLength() : 0) + (v.has_fwd_date() ? v.vfwd_date.innerLength() : 0) + (v.has_reply_to_msg_id() ? v.vreply_to_msg_id.innerLength() : 0) + v.vdate.innerLength() + v.vmessage.innerLength() + (v.has_media() ? v.vmedia.innerLength() : 0) + (v.has_reply_markup() ? v.vreply_markup.innerLength() : 0) + (v.has_entities() ? v.ventities.innerLength() : 0); } case mtpc_messageService: { const MTPDmessageService &v(c_messageService()); @@ -20150,7 +19015,7 @@ inline void MTPmessage::read(const mtpPrime *&from, const mtpPrime *end, mtpType if (v.has_reply_to_msg_id()) { v.vreply_to_msg_id.read(from, end); } else { v.vreply_to_msg_id = MTPint(); } v.vdate.read(from, end); v.vmessage.read(from, end); - v.vmedia.read(from, end); + if (v.has_media()) { v.vmedia.read(from, end); } else { v.vmedia = MTPMessageMedia(); } if (v.has_reply_markup()) { v.vreply_markup.read(from, end); } else { v.vreply_markup = MTPReplyMarkup(); } if (v.has_entities()) { v.ventities.read(from, end); } else { v.ventities = MTPVector(); } } break; @@ -20184,7 +19049,7 @@ inline void MTPmessage::write(mtpBuffer &to) const { if (v.has_reply_to_msg_id()) v.vreply_to_msg_id.write(to); v.vdate.write(to); v.vmessage.write(to); - v.vmedia.write(to); + if (v.has_media()) v.vmedia.write(to); if (v.has_reply_markup()) v.vreply_markup.write(to); if (v.has_entities()) v.ventities.write(to); } break; @@ -20450,10 +19315,6 @@ inline uint32 MTPmessageAction::innerLength() const { const MTPDmessageActionChatDeleteUser &v(c_messageActionChatDeleteUser()); return v.vuser_id.innerLength(); } - case mtpc_messageActionGeoChatCreate: { - const MTPDmessageActionGeoChatCreate &v(c_messageActionGeoChatCreate()); - return v.vtitle.innerLength() + v.vaddress.innerLength(); - } case mtpc_messageActionChatJoinedByLink: { const MTPDmessageActionChatJoinedByLink &v(c_messageActionChatJoinedByLink()); return v.vinviter_id.innerLength(); @@ -20496,13 +19357,6 @@ inline void MTPmessageAction::read(const mtpPrime *&from, const mtpPrime *end, m MTPDmessageActionChatDeleteUser &v(_messageActionChatDeleteUser()); v.vuser_id.read(from, end); } break; - case mtpc_messageActionGeoChatCreate: _type = cons; { - if (!data) setData(new MTPDmessageActionGeoChatCreate()); - MTPDmessageActionGeoChatCreate &v(_messageActionGeoChatCreate()); - v.vtitle.read(from, end); - v.vaddress.read(from, end); - } break; - case mtpc_messageActionGeoChatCheckin: _type = cons; break; case mtpc_messageActionChatJoinedByLink: _type = cons; { if (!data) setData(new MTPDmessageActionChatJoinedByLink()); MTPDmessageActionChatJoinedByLink &v(_messageActionChatJoinedByLink()); @@ -20534,11 +19388,6 @@ inline void MTPmessageAction::write(mtpBuffer &to) const { const MTPDmessageActionChatDeleteUser &v(c_messageActionChatDeleteUser()); v.vuser_id.write(to); } break; - case mtpc_messageActionGeoChatCreate: { - const MTPDmessageActionGeoChatCreate &v(c_messageActionGeoChatCreate()); - v.vtitle.write(to); - v.vaddress.write(to); - } break; case mtpc_messageActionChatJoinedByLink: { const MTPDmessageActionChatJoinedByLink &v(c_messageActionChatJoinedByLink()); v.vinviter_id.write(to); @@ -20554,8 +19403,6 @@ inline MTPmessageAction::MTPmessageAction(mtpTypeId type) : mtpDataOwner(0), _ty case mtpc_messageActionChatDeletePhoto: break; case mtpc_messageActionChatAddUser: setData(new MTPDmessageActionChatAddUser()); break; case mtpc_messageActionChatDeleteUser: setData(new MTPDmessageActionChatDeleteUser()); break; - case mtpc_messageActionGeoChatCreate: setData(new MTPDmessageActionGeoChatCreate()); break; - case mtpc_messageActionGeoChatCheckin: break; case mtpc_messageActionChatJoinedByLink: setData(new MTPDmessageActionChatJoinedByLink()); break; default: throw mtpErrorBadTypeId(type, "MTPmessageAction"); } @@ -20570,8 +19417,6 @@ inline MTPmessageAction::MTPmessageAction(MTPDmessageActionChatAddUser *_data) : } inline MTPmessageAction::MTPmessageAction(MTPDmessageActionChatDeleteUser *_data) : mtpDataOwner(_data), _type(mtpc_messageActionChatDeleteUser) { } -inline MTPmessageAction::MTPmessageAction(MTPDmessageActionGeoChatCreate *_data) : mtpDataOwner(_data), _type(mtpc_messageActionGeoChatCreate) { -} inline MTPmessageAction::MTPmessageAction(MTPDmessageActionChatJoinedByLink *_data) : mtpDataOwner(_data), _type(mtpc_messageActionChatJoinedByLink) { } inline MTPmessageAction MTP_messageActionEmpty() { @@ -20595,12 +19440,6 @@ inline MTPmessageAction MTP_messageActionChatAddUser(MTPint _user_id) { inline MTPmessageAction MTP_messageActionChatDeleteUser(MTPint _user_id) { return MTPmessageAction(new MTPDmessageActionChatDeleteUser(_user_id)); } -inline MTPmessageAction MTP_messageActionGeoChatCreate(const MTPstring &_title, const MTPstring &_address) { - return MTPmessageAction(new MTPDmessageActionGeoChatCreate(_title, _address)); -} -inline MTPmessageAction MTP_messageActionGeoChatCheckin() { - return MTPmessageAction(mtpc_messageActionGeoChatCheckin); -} inline MTPmessageAction MTP_messageActionChatJoinedByLink(MTPint _inviter_id) { return MTPmessageAction(new MTPDmessageActionChatJoinedByLink(_inviter_id)); } @@ -21103,10 +19942,6 @@ inline uint32 MTPinputNotifyPeer::innerLength() const { const MTPDinputNotifyPeer &v(c_inputNotifyPeer()); return v.vpeer.innerLength(); } - case mtpc_inputNotifyGeoChatPeer: { - const MTPDinputNotifyGeoChatPeer &v(c_inputNotifyGeoChatPeer()); - return v.vpeer.innerLength(); - } } return 0; } @@ -21125,11 +19960,6 @@ inline void MTPinputNotifyPeer::read(const mtpPrime *&from, const mtpPrime *end, case mtpc_inputNotifyUsers: _type = cons; break; case mtpc_inputNotifyChats: _type = cons; break; case mtpc_inputNotifyAll: _type = cons; break; - case mtpc_inputNotifyGeoChatPeer: _type = cons; { - if (!data) setData(new MTPDinputNotifyGeoChatPeer()); - MTPDinputNotifyGeoChatPeer &v(_inputNotifyGeoChatPeer()); - v.vpeer.read(from, end); - } break; default: throw mtpErrorUnexpected(cons, "MTPinputNotifyPeer"); } } @@ -21139,10 +19969,6 @@ inline void MTPinputNotifyPeer::write(mtpBuffer &to) const { const MTPDinputNotifyPeer &v(c_inputNotifyPeer()); v.vpeer.write(to); } break; - case mtpc_inputNotifyGeoChatPeer: { - const MTPDinputNotifyGeoChatPeer &v(c_inputNotifyGeoChatPeer()); - v.vpeer.write(to); - } break; } } inline MTPinputNotifyPeer::MTPinputNotifyPeer(mtpTypeId type) : mtpDataOwner(0), _type(type) { @@ -21151,14 +19977,11 @@ inline MTPinputNotifyPeer::MTPinputNotifyPeer(mtpTypeId type) : mtpDataOwner(0), case mtpc_inputNotifyUsers: break; case mtpc_inputNotifyChats: break; case mtpc_inputNotifyAll: break; - case mtpc_inputNotifyGeoChatPeer: setData(new MTPDinputNotifyGeoChatPeer()); break; default: throw mtpErrorBadTypeId(type, "MTPinputNotifyPeer"); } } inline MTPinputNotifyPeer::MTPinputNotifyPeer(MTPDinputNotifyPeer *_data) : mtpDataOwner(_data), _type(mtpc_inputNotifyPeer) { } -inline MTPinputNotifyPeer::MTPinputNotifyPeer(MTPDinputNotifyGeoChatPeer *_data) : mtpDataOwner(_data), _type(mtpc_inputNotifyGeoChatPeer) { -} inline MTPinputNotifyPeer MTP_inputNotifyPeer(const MTPInputPeer &_peer) { return MTPinputNotifyPeer(new MTPDinputNotifyPeer(_peer)); } @@ -21171,9 +19994,6 @@ inline MTPinputNotifyPeer MTP_inputNotifyChats() { inline MTPinputNotifyPeer MTP_inputNotifyAll() { return MTPinputNotifyPeer(mtpc_inputNotifyAll); } -inline MTPinputNotifyPeer MTP_inputNotifyGeoChatPeer(const MTPInputGeoChat &_peer) { - return MTPinputNotifyPeer(new MTPDinputNotifyGeoChatPeer(_peer)); -} inline uint32 MTPinputPeerNotifyEvents::innerLength() const { return 0; @@ -21584,35 +20404,6 @@ inline MTPcontactStatus MTP_contactStatus(MTPint _user_id, const MTPUserStatus & return MTPcontactStatus(new MTPDcontactStatus(_user_id, _status)); } -inline MTPchatLocated::MTPchatLocated() : mtpDataOwner(new MTPDchatLocated()) { -} - -inline uint32 MTPchatLocated::innerLength() const { - const MTPDchatLocated &v(c_chatLocated()); - return v.vchat_id.innerLength() + v.vdistance.innerLength(); -} -inline mtpTypeId MTPchatLocated::type() const { - return mtpc_chatLocated; -} -inline void MTPchatLocated::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { - if (cons != mtpc_chatLocated) throw mtpErrorUnexpected(cons, "MTPchatLocated"); - - if (!data) setData(new MTPDchatLocated()); - MTPDchatLocated &v(_chatLocated()); - v.vchat_id.read(from, end); - v.vdistance.read(from, end); -} -inline void MTPchatLocated::write(mtpBuffer &to) const { - const MTPDchatLocated &v(c_chatLocated()); - v.vchat_id.write(to); - v.vdistance.write(to); -} -inline MTPchatLocated::MTPchatLocated(MTPDchatLocated *_data) : mtpDataOwner(_data) { -} -inline MTPchatLocated MTP_chatLocated(MTPint _chat_id, MTPint _distance) { - return MTPchatLocated(new MTPDchatLocated(_chat_id, _distance)); -} - inline MTPcontacts_link::MTPcontacts_link() : mtpDataOwner(new MTPDcontacts_link()) { } @@ -21974,91 +20765,6 @@ inline MTPmessages_messages MTP_messages_messagesSlice(MTPint _count, const MTPV return MTPmessages_messages(new MTPDmessages_messagesSlice(_count, _messages, _chats, _users)); } -inline uint32 MTPmessages_sentMessage::innerLength() const { - switch (_type) { - case mtpc_messages_sentMessage: { - const MTPDmessages_sentMessage &v(c_messages_sentMessage()); - return v.vid.innerLength() + v.vdate.innerLength() + v.vmedia.innerLength() + v.ventities.innerLength() + v.vpts.innerLength() + v.vpts_count.innerLength(); - } - case mtpc_messages_sentMessageLink: { - const MTPDmessages_sentMessageLink &v(c_messages_sentMessageLink()); - return v.vid.innerLength() + v.vdate.innerLength() + v.vmedia.innerLength() + v.vpts.innerLength() + v.vpts_count.innerLength() + v.vlinks.innerLength() + v.vseq.innerLength(); - } - } - return 0; -} -inline mtpTypeId MTPmessages_sentMessage::type() const { - if (!_type) throw mtpErrorUninitialized(); - return _type; -} -inline void MTPmessages_sentMessage::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { - if (cons != _type) setData(0); - switch (cons) { - case mtpc_messages_sentMessage: _type = cons; { - if (!data) setData(new MTPDmessages_sentMessage()); - MTPDmessages_sentMessage &v(_messages_sentMessage()); - v.vid.read(from, end); - v.vdate.read(from, end); - v.vmedia.read(from, end); - v.ventities.read(from, end); - v.vpts.read(from, end); - v.vpts_count.read(from, end); - } break; - case mtpc_messages_sentMessageLink: _type = cons; { - if (!data) setData(new MTPDmessages_sentMessageLink()); - MTPDmessages_sentMessageLink &v(_messages_sentMessageLink()); - v.vid.read(from, end); - v.vdate.read(from, end); - v.vmedia.read(from, end); - v.vpts.read(from, end); - v.vpts_count.read(from, end); - v.vlinks.read(from, end); - v.vseq.read(from, end); - } break; - default: throw mtpErrorUnexpected(cons, "MTPmessages_sentMessage"); - } -} -inline void MTPmessages_sentMessage::write(mtpBuffer &to) const { - switch (_type) { - case mtpc_messages_sentMessage: { - const MTPDmessages_sentMessage &v(c_messages_sentMessage()); - v.vid.write(to); - v.vdate.write(to); - v.vmedia.write(to); - v.ventities.write(to); - v.vpts.write(to); - v.vpts_count.write(to); - } break; - case mtpc_messages_sentMessageLink: { - const MTPDmessages_sentMessageLink &v(c_messages_sentMessageLink()); - v.vid.write(to); - v.vdate.write(to); - v.vmedia.write(to); - v.vpts.write(to); - v.vpts_count.write(to); - v.vlinks.write(to); - v.vseq.write(to); - } break; - } -} -inline MTPmessages_sentMessage::MTPmessages_sentMessage(mtpTypeId type) : mtpDataOwner(0), _type(type) { - switch (type) { - case mtpc_messages_sentMessage: setData(new MTPDmessages_sentMessage()); break; - case mtpc_messages_sentMessageLink: setData(new MTPDmessages_sentMessageLink()); break; - default: throw mtpErrorBadTypeId(type, "MTPmessages_sentMessage"); - } -} -inline MTPmessages_sentMessage::MTPmessages_sentMessage(MTPDmessages_sentMessage *_data) : mtpDataOwner(_data), _type(mtpc_messages_sentMessage) { -} -inline MTPmessages_sentMessage::MTPmessages_sentMessage(MTPDmessages_sentMessageLink *_data) : mtpDataOwner(_data), _type(mtpc_messages_sentMessageLink) { -} -inline MTPmessages_sentMessage MTP_messages_sentMessage(MTPint _id, MTPint _date, const MTPMessageMedia &_media, const MTPVector &_entities, MTPint _pts, MTPint _pts_count) { - return MTPmessages_sentMessage(new MTPDmessages_sentMessage(_id, _date, _media, _entities, _pts, _pts_count)); -} -inline MTPmessages_sentMessage MTP_messages_sentMessageLink(MTPint _id, MTPint _date, const MTPMessageMedia &_media, MTPint _pts, MTPint _pts_count, const MTPVector &_links, MTPint _seq) { - return MTPmessages_sentMessage(new MTPDmessages_sentMessageLink(_id, _date, _media, _pts, _pts_count, _links, _seq)); -} - inline MTPmessages_chats::MTPmessages_chats() : mtpDataOwner(new MTPDmessages_chats()) { } @@ -22265,10 +20971,6 @@ inline uint32 MTPupdate::innerLength() const { const MTPDupdateNewAuthorization &v(c_updateNewAuthorization()); return v.vauth_key_id.innerLength() + v.vdate.innerLength() + v.vdevice.innerLength() + v.vlocation.innerLength(); } - case mtpc_updateNewGeoChatMessage: { - const MTPDupdateNewGeoChatMessage &v(c_updateNewGeoChatMessage()); - return v.vmessage.innerLength(); - } case mtpc_updateNewEncryptedMessage: { const MTPDupdateNewEncryptedMessage &v(c_updateNewEncryptedMessage()); return v.vmessage.innerLength() + v.vqts.innerLength(); @@ -22424,11 +21126,6 @@ inline void MTPupdate::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeI v.vdevice.read(from, end); v.vlocation.read(from, end); } break; - case mtpc_updateNewGeoChatMessage: _type = cons; { - if (!data) setData(new MTPDupdateNewGeoChatMessage()); - MTPDupdateNewGeoChatMessage &v(_updateNewGeoChatMessage()); - v.vmessage.read(from, end); - } break; case mtpc_updateNewEncryptedMessage: _type = cons; { if (!data) setData(new MTPDupdateNewEncryptedMessage()); MTPDupdateNewEncryptedMessage &v(_updateNewEncryptedMessage()); @@ -22607,10 +21304,6 @@ inline void MTPupdate::write(mtpBuffer &to) const { v.vdevice.write(to); v.vlocation.write(to); } break; - case mtpc_updateNewGeoChatMessage: { - const MTPDupdateNewGeoChatMessage &v(c_updateNewGeoChatMessage()); - v.vmessage.write(to); - } break; case mtpc_updateNewEncryptedMessage: { const MTPDupdateNewEncryptedMessage &v(c_updateNewEncryptedMessage()); v.vmessage.write(to); @@ -22715,7 +21408,6 @@ inline MTPupdate::MTPupdate(mtpTypeId type) : mtpDataOwner(0), _type(type) { case mtpc_updateContactRegistered: setData(new MTPDupdateContactRegistered()); break; case mtpc_updateContactLink: setData(new MTPDupdateContactLink()); break; case mtpc_updateNewAuthorization: setData(new MTPDupdateNewAuthorization()); break; - case mtpc_updateNewGeoChatMessage: setData(new MTPDupdateNewGeoChatMessage()); break; case mtpc_updateNewEncryptedMessage: setData(new MTPDupdateNewEncryptedMessage()); break; case mtpc_updateEncryptedChatTyping: setData(new MTPDupdateEncryptedChatTyping()); break; case mtpc_updateEncryption: setData(new MTPDupdateEncryption()); break; @@ -22759,8 +21451,6 @@ inline MTPupdate::MTPupdate(MTPDupdateContactLink *_data) : mtpDataOwner(_data), } inline MTPupdate::MTPupdate(MTPDupdateNewAuthorization *_data) : mtpDataOwner(_data), _type(mtpc_updateNewAuthorization) { } -inline MTPupdate::MTPupdate(MTPDupdateNewGeoChatMessage *_data) : mtpDataOwner(_data), _type(mtpc_updateNewGeoChatMessage) { -} inline MTPupdate::MTPupdate(MTPDupdateNewEncryptedMessage *_data) : mtpDataOwner(_data), _type(mtpc_updateNewEncryptedMessage) { } inline MTPupdate::MTPupdate(MTPDupdateEncryptedChatTyping *_data) : mtpDataOwner(_data), _type(mtpc_updateEncryptedChatTyping) { @@ -22829,9 +21519,6 @@ inline MTPupdate MTP_updateContactLink(MTPint _user_id, const MTPContactLink &_m inline MTPupdate MTP_updateNewAuthorization(const MTPlong &_auth_key_id, MTPint _date, const MTPstring &_device, const MTPstring &_location) { return MTPupdate(new MTPDupdateNewAuthorization(_auth_key_id, _date, _device, _location)); } -inline MTPupdate MTP_updateNewGeoChatMessage(const MTPGeoChatMessage &_message) { - return MTPupdate(new MTPDupdateNewGeoChatMessage(_message)); -} inline MTPupdate MTP_updateNewEncryptedMessage(const MTPEncryptedMessage &_message, MTPint _qts) { return MTPupdate(new MTPDupdateNewEncryptedMessage(_message, _qts)); } @@ -23042,6 +21729,10 @@ inline uint32 MTPupdates::innerLength() const { const MTPDupdates &v(c_updates()); return v.vupdates.innerLength() + v.vusers.innerLength() + v.vchats.innerLength() + v.vdate.innerLength() + v.vseq.innerLength(); } + case mtpc_updateShortSentMessage: { + const MTPDupdateShortSentMessage &v(c_updateShortSentMessage()); + return v.vflags.innerLength() + v.vid.innerLength() + v.vpts.innerLength() + v.vpts_count.innerLength() + v.vdate.innerLength() + (v.has_media() ? v.vmedia.innerLength() : 0) + (v.has_entities() ? v.ventities.innerLength() : 0); + } } return 0; } @@ -23109,6 +21800,17 @@ inline void MTPupdates::read(const mtpPrime *&from, const mtpPrime *end, mtpType v.vdate.read(from, end); v.vseq.read(from, end); } break; + case mtpc_updateShortSentMessage: _type = cons; { + if (!data) setData(new MTPDupdateShortSentMessage()); + MTPDupdateShortSentMessage &v(_updateShortSentMessage()); + v.vflags.read(from, end); + v.vid.read(from, end); + v.vpts.read(from, end); + v.vpts_count.read(from, end); + v.vdate.read(from, end); + if (v.has_media()) { v.vmedia.read(from, end); } else { v.vmedia = MTPMessageMedia(); } + if (v.has_entities()) { v.ventities.read(from, end); } else { v.ventities = MTPVector(); } + } break; default: throw mtpErrorUnexpected(cons, "MTPupdates"); } } @@ -23165,6 +21867,16 @@ inline void MTPupdates::write(mtpBuffer &to) const { v.vdate.write(to); v.vseq.write(to); } break; + case mtpc_updateShortSentMessage: { + const MTPDupdateShortSentMessage &v(c_updateShortSentMessage()); + v.vflags.write(to); + v.vid.write(to); + v.vpts.write(to); + v.vpts_count.write(to); + v.vdate.write(to); + if (v.has_media()) v.vmedia.write(to); + if (v.has_entities()) v.ventities.write(to); + } break; } } inline MTPupdates::MTPupdates(mtpTypeId type) : mtpDataOwner(0), _type(type) { @@ -23175,6 +21887,7 @@ inline MTPupdates::MTPupdates(mtpTypeId type) : mtpDataOwner(0), _type(type) { case mtpc_updateShort: setData(new MTPDupdateShort()); break; case mtpc_updatesCombined: setData(new MTPDupdatesCombined()); break; case mtpc_updates: setData(new MTPDupdates()); break; + case mtpc_updateShortSentMessage: setData(new MTPDupdateShortSentMessage()); break; default: throw mtpErrorBadTypeId(type, "MTPupdates"); } } @@ -23188,6 +21901,8 @@ inline MTPupdates::MTPupdates(MTPDupdatesCombined *_data) : mtpDataOwner(_data), } inline MTPupdates::MTPupdates(MTPDupdates *_data) : mtpDataOwner(_data), _type(mtpc_updates) { } +inline MTPupdates::MTPupdates(MTPDupdateShortSentMessage *_data) : mtpDataOwner(_data), _type(mtpc_updateShortSentMessage) { +} inline MTPupdates MTP_updatesTooLong() { return MTPupdates(mtpc_updatesTooLong); } @@ -23206,6 +21921,9 @@ inline MTPupdates MTP_updatesCombined(const MTPVector &_updates, cons inline MTPupdates MTP_updates(const MTPVector &_updates, const MTPVector &_users, const MTPVector &_chats, MTPint _date, MTPint _seq) { return MTPupdates(new MTPDupdates(_updates, _users, _chats, _date, _seq)); } +inline MTPupdates MTP_updateShortSentMessage(MTPint _flags, MTPint _id, MTPint _pts, MTPint _pts_count, MTPint _date, const MTPMessageMedia &_media, const MTPVector &_entities) { + return MTPupdates(new MTPDupdateShortSentMessage(_flags, _id, _pts, _pts_count, _date, _media, _entities)); +} inline uint32 MTPphotos_photos::innerLength() const { switch (_type) { @@ -23543,276 +22261,6 @@ inline MTPhelp_inviteText MTP_help_inviteText(const MTPstring &_message) { return MTPhelp_inviteText(new MTPDhelp_inviteText(_message)); } -inline MTPinputGeoChat::MTPinputGeoChat() : mtpDataOwner(new MTPDinputGeoChat()) { -} - -inline uint32 MTPinputGeoChat::innerLength() const { - const MTPDinputGeoChat &v(c_inputGeoChat()); - return v.vchat_id.innerLength() + v.vaccess_hash.innerLength(); -} -inline mtpTypeId MTPinputGeoChat::type() const { - return mtpc_inputGeoChat; -} -inline void MTPinputGeoChat::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { - if (cons != mtpc_inputGeoChat) throw mtpErrorUnexpected(cons, "MTPinputGeoChat"); - - if (!data) setData(new MTPDinputGeoChat()); - MTPDinputGeoChat &v(_inputGeoChat()); - v.vchat_id.read(from, end); - v.vaccess_hash.read(from, end); -} -inline void MTPinputGeoChat::write(mtpBuffer &to) const { - const MTPDinputGeoChat &v(c_inputGeoChat()); - v.vchat_id.write(to); - v.vaccess_hash.write(to); -} -inline MTPinputGeoChat::MTPinputGeoChat(MTPDinputGeoChat *_data) : mtpDataOwner(_data) { -} -inline MTPinputGeoChat MTP_inputGeoChat(MTPint _chat_id, const MTPlong &_access_hash) { - return MTPinputGeoChat(new MTPDinputGeoChat(_chat_id, _access_hash)); -} - -inline uint32 MTPgeoChatMessage::innerLength() const { - switch (_type) { - case mtpc_geoChatMessageEmpty: { - const MTPDgeoChatMessageEmpty &v(c_geoChatMessageEmpty()); - return v.vchat_id.innerLength() + v.vid.innerLength(); - } - case mtpc_geoChatMessage: { - const MTPDgeoChatMessage &v(c_geoChatMessage()); - return v.vchat_id.innerLength() + v.vid.innerLength() + v.vfrom_id.innerLength() + v.vdate.innerLength() + v.vmessage.innerLength() + v.vmedia.innerLength(); - } - case mtpc_geoChatMessageService: { - const MTPDgeoChatMessageService &v(c_geoChatMessageService()); - return v.vchat_id.innerLength() + v.vid.innerLength() + v.vfrom_id.innerLength() + v.vdate.innerLength() + v.vaction.innerLength(); - } - } - return 0; -} -inline mtpTypeId MTPgeoChatMessage::type() const { - if (!_type) throw mtpErrorUninitialized(); - return _type; -} -inline void MTPgeoChatMessage::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { - if (cons != _type) setData(0); - switch (cons) { - case mtpc_geoChatMessageEmpty: _type = cons; { - if (!data) setData(new MTPDgeoChatMessageEmpty()); - MTPDgeoChatMessageEmpty &v(_geoChatMessageEmpty()); - v.vchat_id.read(from, end); - v.vid.read(from, end); - } break; - case mtpc_geoChatMessage: _type = cons; { - if (!data) setData(new MTPDgeoChatMessage()); - MTPDgeoChatMessage &v(_geoChatMessage()); - v.vchat_id.read(from, end); - v.vid.read(from, end); - v.vfrom_id.read(from, end); - v.vdate.read(from, end); - v.vmessage.read(from, end); - v.vmedia.read(from, end); - } break; - case mtpc_geoChatMessageService: _type = cons; { - if (!data) setData(new MTPDgeoChatMessageService()); - MTPDgeoChatMessageService &v(_geoChatMessageService()); - v.vchat_id.read(from, end); - v.vid.read(from, end); - v.vfrom_id.read(from, end); - v.vdate.read(from, end); - v.vaction.read(from, end); - } break; - default: throw mtpErrorUnexpected(cons, "MTPgeoChatMessage"); - } -} -inline void MTPgeoChatMessage::write(mtpBuffer &to) const { - switch (_type) { - case mtpc_geoChatMessageEmpty: { - const MTPDgeoChatMessageEmpty &v(c_geoChatMessageEmpty()); - v.vchat_id.write(to); - v.vid.write(to); - } break; - case mtpc_geoChatMessage: { - const MTPDgeoChatMessage &v(c_geoChatMessage()); - v.vchat_id.write(to); - v.vid.write(to); - v.vfrom_id.write(to); - v.vdate.write(to); - v.vmessage.write(to); - v.vmedia.write(to); - } break; - case mtpc_geoChatMessageService: { - const MTPDgeoChatMessageService &v(c_geoChatMessageService()); - v.vchat_id.write(to); - v.vid.write(to); - v.vfrom_id.write(to); - v.vdate.write(to); - v.vaction.write(to); - } break; - } -} -inline MTPgeoChatMessage::MTPgeoChatMessage(mtpTypeId type) : mtpDataOwner(0), _type(type) { - switch (type) { - case mtpc_geoChatMessageEmpty: setData(new MTPDgeoChatMessageEmpty()); break; - case mtpc_geoChatMessage: setData(new MTPDgeoChatMessage()); break; - case mtpc_geoChatMessageService: setData(new MTPDgeoChatMessageService()); break; - default: throw mtpErrorBadTypeId(type, "MTPgeoChatMessage"); - } -} -inline MTPgeoChatMessage::MTPgeoChatMessage(MTPDgeoChatMessageEmpty *_data) : mtpDataOwner(_data), _type(mtpc_geoChatMessageEmpty) { -} -inline MTPgeoChatMessage::MTPgeoChatMessage(MTPDgeoChatMessage *_data) : mtpDataOwner(_data), _type(mtpc_geoChatMessage) { -} -inline MTPgeoChatMessage::MTPgeoChatMessage(MTPDgeoChatMessageService *_data) : mtpDataOwner(_data), _type(mtpc_geoChatMessageService) { -} -inline MTPgeoChatMessage MTP_geoChatMessageEmpty(MTPint _chat_id, MTPint _id) { - return MTPgeoChatMessage(new MTPDgeoChatMessageEmpty(_chat_id, _id)); -} -inline MTPgeoChatMessage MTP_geoChatMessage(MTPint _chat_id, MTPint _id, MTPint _from_id, MTPint _date, const MTPstring &_message, const MTPMessageMedia &_media) { - return MTPgeoChatMessage(new MTPDgeoChatMessage(_chat_id, _id, _from_id, _date, _message, _media)); -} -inline MTPgeoChatMessage MTP_geoChatMessageService(MTPint _chat_id, MTPint _id, MTPint _from_id, MTPint _date, const MTPMessageAction &_action) { - return MTPgeoChatMessage(new MTPDgeoChatMessageService(_chat_id, _id, _from_id, _date, _action)); -} - -inline MTPgeochats_statedMessage::MTPgeochats_statedMessage() : mtpDataOwner(new MTPDgeochats_statedMessage()) { -} - -inline uint32 MTPgeochats_statedMessage::innerLength() const { - const MTPDgeochats_statedMessage &v(c_geochats_statedMessage()); - return v.vmessage.innerLength() + v.vchats.innerLength() + v.vusers.innerLength() + v.vseq.innerLength(); -} -inline mtpTypeId MTPgeochats_statedMessage::type() const { - return mtpc_geochats_statedMessage; -} -inline void MTPgeochats_statedMessage::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { - if (cons != mtpc_geochats_statedMessage) throw mtpErrorUnexpected(cons, "MTPgeochats_statedMessage"); - - if (!data) setData(new MTPDgeochats_statedMessage()); - MTPDgeochats_statedMessage &v(_geochats_statedMessage()); - v.vmessage.read(from, end); - v.vchats.read(from, end); - v.vusers.read(from, end); - v.vseq.read(from, end); -} -inline void MTPgeochats_statedMessage::write(mtpBuffer &to) const { - const MTPDgeochats_statedMessage &v(c_geochats_statedMessage()); - v.vmessage.write(to); - v.vchats.write(to); - v.vusers.write(to); - v.vseq.write(to); -} -inline MTPgeochats_statedMessage::MTPgeochats_statedMessage(MTPDgeochats_statedMessage *_data) : mtpDataOwner(_data) { -} -inline MTPgeochats_statedMessage MTP_geochats_statedMessage(const MTPGeoChatMessage &_message, const MTPVector &_chats, const MTPVector &_users, MTPint _seq) { - return MTPgeochats_statedMessage(new MTPDgeochats_statedMessage(_message, _chats, _users, _seq)); -} - -inline MTPgeochats_located::MTPgeochats_located() : mtpDataOwner(new MTPDgeochats_located()) { -} - -inline uint32 MTPgeochats_located::innerLength() const { - const MTPDgeochats_located &v(c_geochats_located()); - return v.vresults.innerLength() + v.vmessages.innerLength() + v.vchats.innerLength() + v.vusers.innerLength(); -} -inline mtpTypeId MTPgeochats_located::type() const { - return mtpc_geochats_located; -} -inline void MTPgeochats_located::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { - if (cons != mtpc_geochats_located) throw mtpErrorUnexpected(cons, "MTPgeochats_located"); - - if (!data) setData(new MTPDgeochats_located()); - MTPDgeochats_located &v(_geochats_located()); - v.vresults.read(from, end); - v.vmessages.read(from, end); - v.vchats.read(from, end); - v.vusers.read(from, end); -} -inline void MTPgeochats_located::write(mtpBuffer &to) const { - const MTPDgeochats_located &v(c_geochats_located()); - v.vresults.write(to); - v.vmessages.write(to); - v.vchats.write(to); - v.vusers.write(to); -} -inline MTPgeochats_located::MTPgeochats_located(MTPDgeochats_located *_data) : mtpDataOwner(_data) { -} -inline MTPgeochats_located MTP_geochats_located(const MTPVector &_results, const MTPVector &_messages, const MTPVector &_chats, const MTPVector &_users) { - return MTPgeochats_located(new MTPDgeochats_located(_results, _messages, _chats, _users)); -} - -inline uint32 MTPgeochats_messages::innerLength() const { - switch (_type) { - case mtpc_geochats_messages: { - const MTPDgeochats_messages &v(c_geochats_messages()); - return v.vmessages.innerLength() + v.vchats.innerLength() + v.vusers.innerLength(); - } - case mtpc_geochats_messagesSlice: { - const MTPDgeochats_messagesSlice &v(c_geochats_messagesSlice()); - return v.vcount.innerLength() + v.vmessages.innerLength() + v.vchats.innerLength() + v.vusers.innerLength(); - } - } - return 0; -} -inline mtpTypeId MTPgeochats_messages::type() const { - if (!_type) throw mtpErrorUninitialized(); - return _type; -} -inline void MTPgeochats_messages::read(const mtpPrime *&from, const mtpPrime *end, mtpTypeId cons) { - if (cons != _type) setData(0); - switch (cons) { - case mtpc_geochats_messages: _type = cons; { - if (!data) setData(new MTPDgeochats_messages()); - MTPDgeochats_messages &v(_geochats_messages()); - v.vmessages.read(from, end); - v.vchats.read(from, end); - v.vusers.read(from, end); - } break; - case mtpc_geochats_messagesSlice: _type = cons; { - if (!data) setData(new MTPDgeochats_messagesSlice()); - MTPDgeochats_messagesSlice &v(_geochats_messagesSlice()); - v.vcount.read(from, end); - v.vmessages.read(from, end); - v.vchats.read(from, end); - v.vusers.read(from, end); - } break; - default: throw mtpErrorUnexpected(cons, "MTPgeochats_messages"); - } -} -inline void MTPgeochats_messages::write(mtpBuffer &to) const { - switch (_type) { - case mtpc_geochats_messages: { - const MTPDgeochats_messages &v(c_geochats_messages()); - v.vmessages.write(to); - v.vchats.write(to); - v.vusers.write(to); - } break; - case mtpc_geochats_messagesSlice: { - const MTPDgeochats_messagesSlice &v(c_geochats_messagesSlice()); - v.vcount.write(to); - v.vmessages.write(to); - v.vchats.write(to); - v.vusers.write(to); - } break; - } -} -inline MTPgeochats_messages::MTPgeochats_messages(mtpTypeId type) : mtpDataOwner(0), _type(type) { - switch (type) { - case mtpc_geochats_messages: setData(new MTPDgeochats_messages()); break; - case mtpc_geochats_messagesSlice: setData(new MTPDgeochats_messagesSlice()); break; - default: throw mtpErrorBadTypeId(type, "MTPgeochats_messages"); - } -} -inline MTPgeochats_messages::MTPgeochats_messages(MTPDgeochats_messages *_data) : mtpDataOwner(_data), _type(mtpc_geochats_messages) { -} -inline MTPgeochats_messages::MTPgeochats_messages(MTPDgeochats_messagesSlice *_data) : mtpDataOwner(_data), _type(mtpc_geochats_messagesSlice) { -} -inline MTPgeochats_messages MTP_geochats_messages(const MTPVector &_messages, const MTPVector &_chats, const MTPVector &_users) { - return MTPgeochats_messages(new MTPDgeochats_messages(_messages, _chats, _users)); -} -inline MTPgeochats_messages MTP_geochats_messagesSlice(MTPint _count, const MTPVector &_messages, const MTPVector &_chats, const MTPVector &_users) { - return MTPgeochats_messages(new MTPDgeochats_messagesSlice(_count, _messages, _chats, _users)); -} - inline uint32 MTPencryptedChat::innerLength() const { switch (_type) { case mtpc_encryptedChatEmpty: { @@ -25547,7 +23995,7 @@ inline uint32 MTPwebPage::innerLength() const { } case mtpc_webPage: { const MTPDwebPage &v(c_webPage()); - return v.vflags.innerLength() + v.vid.innerLength() + v.vurl.innerLength() + v.vdisplay_url.innerLength() + (v.has_type() ? v.vtype.innerLength() : 0) + (v.has_site_name() ? v.vsite_name.innerLength() : 0) + (v.has_title() ? v.vtitle.innerLength() : 0) + (v.has_description() ? v.vdescription.innerLength() : 0) + (v.has_photo() ? v.vphoto.innerLength() : 0) + (v.has_embed_url() ? v.vembed_url.innerLength() : 0) + (v.has_embed_type() ? v.vembed_type.innerLength() : 0) + (v.has_embed_width() ? v.vembed_width.innerLength() : 0) + (v.has_embed_height() ? v.vembed_height.innerLength() : 0) + (v.has_duration() ? v.vduration.innerLength() : 0) + (v.has_author() ? v.vauthor.innerLength() : 0); + return v.vflags.innerLength() + v.vid.innerLength() + v.vurl.innerLength() + v.vdisplay_url.innerLength() + (v.has_type() ? v.vtype.innerLength() : 0) + (v.has_site_name() ? v.vsite_name.innerLength() : 0) + (v.has_title() ? v.vtitle.innerLength() : 0) + (v.has_description() ? v.vdescription.innerLength() : 0) + (v.has_photo() ? v.vphoto.innerLength() : 0) + (v.has_embed_url() ? v.vembed_url.innerLength() : 0) + (v.has_embed_type() ? v.vembed_type.innerLength() : 0) + (v.has_embed_width() ? v.vembed_width.innerLength() : 0) + (v.has_embed_height() ? v.vembed_height.innerLength() : 0) + (v.has_duration() ? v.vduration.innerLength() : 0) + (v.has_author() ? v.vauthor.innerLength() : 0) + (v.has_document() ? v.vdocument.innerLength() : 0); } } return 0; @@ -25588,6 +24036,7 @@ inline void MTPwebPage::read(const mtpPrime *&from, const mtpPrime *end, mtpType if (v.has_embed_height()) { v.vembed_height.read(from, end); } else { v.vembed_height = MTPint(); } if (v.has_duration()) { v.vduration.read(from, end); } else { v.vduration = MTPint(); } if (v.has_author()) { v.vauthor.read(from, end); } else { v.vauthor = MTPstring(); } + if (v.has_document()) { v.vdocument.read(from, end); } else { v.vdocument = MTPDocument(); } } break; default: throw mtpErrorUnexpected(cons, "MTPwebPage"); } @@ -25620,6 +24069,7 @@ inline void MTPwebPage::write(mtpBuffer &to) const { if (v.has_embed_height()) v.vembed_height.write(to); if (v.has_duration()) v.vduration.write(to); if (v.has_author()) v.vauthor.write(to); + if (v.has_document()) v.vdocument.write(to); } break; } } @@ -25643,8 +24093,8 @@ inline MTPwebPage MTP_webPageEmpty(const MTPlong &_id) { inline MTPwebPage MTP_webPagePending(const MTPlong &_id, MTPint _date) { return MTPwebPage(new MTPDwebPagePending(_id, _date)); } -inline MTPwebPage MTP_webPage(MTPint _flags, const MTPlong &_id, const MTPstring &_url, const MTPstring &_display_url, const MTPstring &_type, const MTPstring &_site_name, const MTPstring &_title, const MTPstring &_description, const MTPPhoto &_photo, const MTPstring &_embed_url, const MTPstring &_embed_type, MTPint _embed_width, MTPint _embed_height, MTPint _duration, const MTPstring &_author) { - return MTPwebPage(new MTPDwebPage(_flags, _id, _url, _display_url, _type, _site_name, _title, _description, _photo, _embed_url, _embed_type, _embed_width, _embed_height, _duration, _author)); +inline MTPwebPage MTP_webPage(MTPint _flags, const MTPlong &_id, const MTPstring &_url, const MTPstring &_display_url, const MTPstring &_type, const MTPstring &_site_name, const MTPstring &_title, const MTPstring &_description, const MTPPhoto &_photo, const MTPstring &_embed_url, const MTPstring &_embed_type, MTPint _embed_width, MTPint _embed_height, MTPint _duration, const MTPstring &_author, const MTPDocument &_document) { + return MTPwebPage(new MTPDwebPage(_flags, _id, _url, _display_url, _type, _site_name, _title, _description, _photo, _embed_url, _embed_type, _embed_width, _embed_height, _duration, _author, _document)); } inline MTPauthorization::MTPauthorization() : mtpDataOwner(new MTPDauthorization()) { diff --git a/Telegram/SourceFiles/mtproto/scheme.tl b/Telegram/SourceFiles/mtproto/scheme.tl index 440d0eb3f..66803e904 100644 --- a/Telegram/SourceFiles/mtproto/scheme.tl +++ b/Telegram/SourceFiles/mtproto/scheme.tl @@ -146,8 +146,8 @@ inputMediaUploadedPhoto#f7aff1c0 file:InputFile caption:string = InputMedia; inputMediaPhoto#e9bfb4f3 id:InputPhoto caption:string = InputMedia; inputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia; inputMediaContact#a6e45987 phone_number:string first_name:string last_name:string = InputMedia; -inputMediaUploadedVideo#e13fd4bc file:InputFile duration:int w:int h:int caption:string = InputMedia; -inputMediaUploadedThumbVideo#96fb97dc file:InputFile thumb:InputFile duration:int w:int h:int caption:string = InputMedia; +inputMediaUploadedVideo#82713fdf file:InputFile duration:int w:int h:int mime_type:string caption:string = InputMedia; +inputMediaUploadedThumbVideo#7780ddf9 file:InputFile thumb:InputFile duration:int w:int h:int mime_type:string caption:string = InputMedia; inputMediaVideo#936a4ebd id:InputVideo caption:string = InputMedia; inputChatPhotoEmpty#1ca48f57 = InputChatPhoto; @@ -212,7 +212,7 @@ chatPhotoEmpty#37c1011c = ChatPhoto; chatPhoto#6153276a photo_small:FileLocation photo_big:FileLocation = ChatPhoto; messageEmpty#83e5de54 id:int = Message; -message#f07814c8 flags:# id:int from_id:int to_id:Peer fwd_from_id:flags.2?int fwd_date:flags.2?int reply_to_msg_id:flags.3?int date:int message:string media:MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector = Message; +message#2bebfa86 flags:# id:int from_id:int to_id:Peer fwd_from_id:flags.2?int 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 = Message; messageService#1d86f70e flags:int id:int from_id:int to_id:Peer date:int action:MessageAction = Message; messageMediaEmpty#3ded6320 = MessageMedia; @@ -283,8 +283,6 @@ contactSuggested#3de191a1 user_id:int mutual_contacts:int = ContactSuggested; contactStatus#d3680c61 user_id:int status:UserStatus = ContactStatus; -chatLocated#3631cf4c chat_id:int distance:int = ChatLocated; - contacts.link#3ace484c my_link:ContactLink foreign_link:ContactLink user:User = contacts.Link; contacts.contactsNotModified#b74ba9d2 = contacts.Contacts; @@ -303,8 +301,6 @@ messages.dialogsSlice#71e094f3 count:int dialogs:Vector messages:Vector< messages.messages#8c718e87 messages:Vector chats:Vector users:Vector = messages.Messages; messages.messagesSlice#b446ae3 count:int messages:Vector chats:Vector users:Vector = messages.Messages; -messages.sentMessage#8a99d8e0 id:int date:int media:MessageMedia entities:Vector pts:int pts_count:int = messages.SentMessage; - messages.chats#64ff9fd5 chats:Vector = messages.Chats; messages.chatFull#e5d7d19c full_chat:ChatFull chats:Vector users:Vector = messages.ChatFull; @@ -365,30 +361,6 @@ help.noAppUpdate#c45a6536 = help.AppUpdate; help.inviteText#18cb9f78 message:string = help.InviteText; -messages.sentMessageLink#35a1a663 id:int date:int media:MessageMedia pts:int pts_count:int links:Vector seq:int = messages.SentMessage; - -inputGeoChat#74d456fa chat_id:int access_hash:long = InputGeoChat; - -inputNotifyGeoChatPeer#4d8ddec8 peer:InputGeoChat = InputNotifyPeer; - -geoChat#75eaea5a id:int access_hash:long title:string address:string venue:string geo:GeoPoint photo:ChatPhoto participants_count:int date:int checked_in:Bool version:int = Chat; - -geoChatMessageEmpty#60311a9b chat_id:int id:int = GeoChatMessage; -geoChatMessage#4505f8e1 chat_id:int id:int from_id:int date:int message:string media:MessageMedia = GeoChatMessage; -geoChatMessageService#d34fa24e chat_id:int id:int from_id:int date:int action:MessageAction = GeoChatMessage; - -geochats.statedMessage#17b1578b message:GeoChatMessage chats:Vector users:Vector seq:int = geochats.StatedMessage; - -geochats.located#48feb267 results:Vector messages:Vector chats:Vector users:Vector = geochats.Located; - -geochats.messages#d1526db1 messages:Vector chats:Vector users:Vector = geochats.Messages; -geochats.messagesSlice#bc5863e8 count:int messages:Vector chats:Vector users:Vector = geochats.Messages; - -messageActionGeoChatCreate#6f038ebc title:string address:string = MessageAction; -messageActionGeoChatCheckin#c7d53de = MessageAction; - -updateNewGeoChatMessage#5a68e3f7 message:GeoChatMessage = Update; - wallPaperSolid#63117f24 id:int title:string bg_color:int color:int = WallPaper; updateNewEncryptedMessage#12bcbd9a message:EncryptedMessage qts:int = Update; @@ -546,7 +518,7 @@ updateWebPage#2cc36971 webpage:WebPage = Update; webPageEmpty#eb1477e8 id:long = WebPage; webPagePending#c586da1c id:long date:int = WebPage; -webPage#a31ea0b5 flags:# id:long url:string display_url:string type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string = WebPage; +webPage#ca820ed7 flags:# id:long url:string display_url:string type:flags.0?string site_name:flags.1?string title:flags.2?string description:flags.3?string photo:flags.4?Photo embed_url:flags.5?string embed_type:flags.5?string embed_width:flags.6?int embed_height:flags.6?int duration:flags.7?int author:flags.8?string document:flags.9?Document = WebPage; messageMediaWebPage#a32dd600 webpage:WebPage = MessageMedia; @@ -621,6 +593,8 @@ messageEntityCode#28a20571 offset:int length:int = MessageEntity; messageEntityPre#73924be0 offset:int length:int language:string = MessageEntity; messageEntityTextUrl#76a6d327 offset:int length:int url:string = MessageEntity; +updateShortSentMessage#11f1331c flags:# id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector = Updates; + ---functions--- invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X; @@ -672,7 +646,7 @@ messages.deleteHistory#f4f8fb61 peer:InputPeer offset:int = messages.AffectedHis messages.deleteMessages#a5f18925 id:Vector = messages.AffectedMessages; messages.receivedMessages#5a954c0 max_id:int = Vector; messages.setTyping#a3825e50 peer:InputPeer action:SendMessageAction = Bool; -messages.sendMessage#df12390 flags:# peer:InputPeer reply_to_msg_id:flags.0?int message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector = messages.SentMessage; +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 = Updates; messages.sendMedia#c8f16791 flags:# peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia random_id:long reply_markup:flags.2?ReplyMarkup = Updates; messages.forwardMessages#55e1728d peer:InputPeer id:Vector random_id:Vector = Updates; messages.getChats#3c6aa187 id:Vector = messages.Chats; @@ -703,20 +677,6 @@ photos.getUserPhotos#91cd32a8 user_id:InputUser offset:int max_id:long limit:int messages.forwardMessage#33963bf9 peer:InputPeer id:int random_id:long = Updates; messages.sendBroadcast#bf73f4da contacts:Vector random_id:Vector message:string media:InputMedia = Updates; - -geochats.getLocated#7f192d8f geo_point:InputGeoPoint radius:int limit:int = geochats.Located; -geochats.getRecents#e1427e6f offset:int limit:int = geochats.Messages; -geochats.checkin#55b3e8fb peer:InputGeoChat = geochats.StatedMessage; -geochats.getFullChat#6722dd6f peer:InputGeoChat = messages.ChatFull; -geochats.editChatTitle#4c8e2273 peer:InputGeoChat title:string address:string = geochats.StatedMessage; -geochats.editChatPhoto#35d81a95 peer:InputGeoChat photo:InputChatPhoto = geochats.StatedMessage; -geochats.search#cfcdc44d peer:InputGeoChat q:string filter:MessagesFilter min_date:int max_date:int offset:int max_id:int limit:int = geochats.Messages; -geochats.getHistory#b53f7a68 peer:InputGeoChat offset:int max_id:int limit:int = geochats.Messages; -geochats.setTyping#8b8a729 peer:InputGeoChat typing:Bool = Bool; -geochats.sendMessage#61b0044 peer:InputGeoChat message:string random_id:long = geochats.StatedMessage; -geochats.sendMedia#b8f0deff peer:InputGeoChat media:InputMedia random_id:long = geochats.StatedMessage; -geochats.createGeoChat#e092e16 title:string geo_point:InputGeoPoint address:string venue:string = geochats.StatedMessage; - messages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig; messages.requestEncryption#f64daf43 user_id:InputUser random_id:int g_a:bytes = EncryptedChat; messages.acceptEncryption#3dbc0415 peer:InputEncryptedChat g_b:bytes key_fingerprint:long = EncryptedChat; diff --git a/Telegram/SourceFiles/overviewwidget.cpp b/Telegram/SourceFiles/overviewwidget.cpp index 951fb8911..51ff04353 100644 --- a/Telegram/SourceFiles/overviewwidget.cpp +++ b/Telegram/SourceFiles/overviewwidget.cpp @@ -1105,6 +1105,8 @@ void OverviewInner::paintEvent(QPaintEvent *e) { pix = page->photo->thumb->pixBlurredSingle(lnk->pixw, lnk->pixh, st::dlgPhotoSize, st::dlgPhotoSize); } p.drawPixmap(0, top, pix); + } else if (page && page->doc && !page->doc->thumb->isNull()) { + p.drawPixmap(0, top, page->doc->thumb->pixSingle(lnk->pixw, lnk->pixh, st::dlgPhotoSize, st::dlgPhotoSize)); } else { int32 index = lnk->letter.isEmpty() ? 0 : (lnk->letter.at(0).unicode() % 4); switch (index) { diff --git a/Telegram/SourceFiles/structs.cpp b/Telegram/SourceFiles/structs.cpp index 86885d11e..584b3314e 100644 --- a/Telegram/SourceFiles/structs.cpp +++ b/Telegram/SourceFiles/structs.cpp @@ -774,8 +774,8 @@ QString DocumentData::already(bool check) { return location.name; } -WebPageData::WebPageData(const WebPageId &id, WebPageType type, const QString &url, const QString &displayUrl, const QString &siteName, const QString &title, const QString &description, PhotoData *photo, int32 duration, const QString &author, int32 pendingTill) : -id(id), type(type), url(url), displayUrl(displayUrl), siteName(siteName), title(title), description(description), duration(duration), author(author), photo(photo), pendingTill(pendingTill) { +WebPageData::WebPageData(const WebPageId &id, WebPageType type, const QString &url, const QString &displayUrl, const QString &siteName, const QString &title, const QString &description, PhotoData *photo, DocumentData *doc, int32 duration, const QString &author, int32 pendingTill) : +id(id), type(type), url(url), displayUrl(displayUrl), siteName(siteName), title(title), description(description), duration(duration), author(author), photo(photo), doc(doc), pendingTill(pendingTill) { } void PeerLink::onClick(Qt::MouseButton button) const { diff --git a/Telegram/SourceFiles/structs.h b/Telegram/SourceFiles/structs.h index bbc1b41b3..32efe1053 100644 --- a/Telegram/SourceFiles/structs.h +++ b/Telegram/SourceFiles/structs.h @@ -548,6 +548,19 @@ struct DocumentData { if (sticker()) sticker()->img->forget(); replyPreview->forget(); } + ImagePtr makeReplyPreview() { + if (replyPreview->isNull() && !thumb->isNull()) { + if (thumb->loaded()) { + int w = thumb->width(), h = thumb->height(); + if (w <= 0) w = 1; + if (h <= 0) h = 1; + replyPreview = ImagePtr(w > h ? thumb->pix(w * st::msgReplyBarSize.height() / h, st::msgReplyBarSize.height()) : thumb->pix(st::msgReplyBarSize.height()), "PNG"); + } else { + thumb->load(); + } + } + return replyPreview; + } void save(const QString &toFile); @@ -687,7 +700,7 @@ inline WebPageType toWebPageType(const QString &type) { } struct WebPageData { - WebPageData(const WebPageId &id, WebPageType type = WebPageArticle, const QString &url = QString(), const QString &displayUrl = QString(), const QString &siteName = QString(), const QString &title = QString(), const QString &description = QString(), PhotoData *photo = 0, int32 duration = 0, const QString &author = QString(), int32 pendingTill = -1); + WebPageData(const WebPageId &id, WebPageType type = WebPageArticle, const QString &url = QString(), const QString &displayUrl = QString(), const QString &siteName = QString(), const QString &title = QString(), const QString &description = QString(), PhotoData *photo = 0, DocumentData *doc = 0, int32 duration = 0, const QString &author = QString(), int32 pendingTill = -1); void forget() { if (photo) photo->forget(); @@ -699,6 +712,7 @@ struct WebPageData { int32 duration; QString author; PhotoData *photo; + DocumentData *doc; int32 pendingTill; };