diff --git a/Telegram/SourceFiles/boxes/peers/edit_peer_color_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_peer_color_box.cpp index 1913675afb5f93..4d1c46bdd94c05 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_peer_color_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_peer_color_box.cpp @@ -298,7 +298,9 @@ PreviewWrap::PreviewWrap( ? tr::lng_settings_color_reply(tr::now) : tr::lng_settings_color_reply_channel(tr::now), }, +#if 0 // mtp MTP_messageMediaEmpty(), +#endif HistoryMessageMarkupData(), uint64(0))) , _replyItem(_history->addNewLocalMessage( @@ -316,6 +318,7 @@ PreviewWrap::PreviewWrap( ? tr::lng_settings_color_text(tr::now) : tr::lng_settings_color_text_channel(tr::now), }, +#if 0 // mtp MTP_messageMediaWebPage( MTP_flags(0), MTP_webPagePending( @@ -323,12 +326,21 @@ PreviewWrap::PreviewWrap( MTP_long(_webpage->id), MTPstring(), MTP_int(0))), +#endif HistoryMessageMarkupData(), uint64(0))) +#if 0 // mtp , _element(_replyItem->createView(_delegate.get())) +#endif , _position(0, st::msgMargin.bottom()) { _style->apply(_theme.get()); + _replyItem->setMediaExplicit(std::make_unique( + _replyItem.get(), + _webpage.get(), + MediaWebPageFlag::Manual)); + _element = _replyItem->createView(_delegate.get()); + _fake->setName(peer->name(), QString()); std::move(colorIndexValue) | rpl::start_with_next([=](uint8 index) { _fake->changeColorIndex(index); @@ -449,6 +461,7 @@ void Set( ? tr::lng_settings_color_changed(tr::now) : tr::lng_settings_color_changed_channel(tr::now)); }; +#if 0 // todo const auto fail = [=](const MTP::Error &error) { setLocal(wasIndex, wasEmojiId); show->showToast(error.type()); @@ -474,6 +487,7 @@ void Set( } else { Unexpected("Invalid peer type in Set(colorIndex)."); } +#endif } void Apply( @@ -503,6 +517,7 @@ void Apply( Set(show, peer, colorIndex, backgroundEmojiId); close(); } else { +#if 0 // todo session->api().request(MTPpremium_GetBoostsStatus( peer->input )).done([=](const MTPpremium_BoostsStatus &result) { @@ -533,6 +548,7 @@ void Apply( show->showToast(error.type()); cancel(); }).send(); +#endif } } diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index ece59ccf65d850..d1183b1e1b9d3a 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -4572,6 +4572,11 @@ void HistoryItem::setMedia(const TLmessageContent &content) { checkBuyButton(); } +void HistoryItem::setMediaExplicit(std::unique_ptr media) { + _media = std::move(media); + checkBuyButton(); +} + void HistoryItem::setContent(const TLmessageContent &content) { _flags &= ~(MessageFlag::IsGroupEssential) & ~(MessageFlag::IsContactSignUp); diff --git a/Telegram/SourceFiles/history/history_item.h b/Telegram/SourceFiles/history/history_item.h index 416752697f024b..f2b1b56ec2f6f7 100644 --- a/Telegram/SourceFiles/history/history_item.h +++ b/Telegram/SourceFiles/history/history_item.h @@ -560,6 +560,7 @@ class HistoryItem final : public RuntimeComposer { void customEmojiRepaint(); void updateContent(const Tdb::TLmessageContent &content); + void setMediaExplicit(std::unique_ptr media); void updateInteractionInfo(const Tdb::TLmessageInteractionInfo *info); void updateEditedInfo( TimeId editDate,