diff --git a/Telegram/SourceFiles/api/api_bot.cpp b/Telegram/SourceFiles/api/api_bot.cpp index 0284ae719..befdc04e5 100644 --- a/Telegram/SourceFiles/api/api_bot.cpp +++ b/Telegram/SourceFiles/api/api_bot.cpp @@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "apiwrap.h" #include "api/api_cloud_password.h" #include "api/api_send_progress.h" +#include "boxes/send_credits_box.h" #include "boxes/share_box.h" #include "boxes/passcode_box.h" #include "boxes/url_auth_box.h" @@ -330,12 +331,16 @@ void ActivateBotCommand(ClickHandlerContext context, int row, int column) { } break; case ButtonType::Buy: { - Payments::CheckoutProcess::Start( - item, - Payments::Mode::Payment, - crl::guard(controller, [=](auto) { - controller->widget()->activate(); - })); + if (Ui::IsCreditsInvoice(item)) { + controller->uiShow()->show(Box(Ui::SendCreditsBox, item)); + } else { + Payments::CheckoutProcess::Start( + item, + Payments::Mode::Payment, + crl::guard(controller, [=](auto) { + controller->widget()->activate(); + })); + } } break; case ButtonType::Url: { diff --git a/Telegram/SourceFiles/history/view/media/history_view_invoice.cpp b/Telegram/SourceFiles/history/view/media/history_view_invoice.cpp index 95676cc89..65987e6bb 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_invoice.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_invoice.cpp @@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #include "history/view/media/history_view_invoice.h" +#include "boxes/send_credits_box.h" // IsCreditsInvoice. #include "lang/lang_keys.h" #include "history/view/history_view_element.h" #include "history/view/history_view_cursor_state.h" @@ -34,7 +35,8 @@ Invoice::Invoice( } void Invoice::fillFromData(not_null invoice) { - if (invoice->photo) { + const auto isCreditsCurrency = Ui::IsCreditsInvoice(_parent->data()); + if (invoice->photo && !isCreditsCurrency) { const auto spoiler = false; _attach = std::make_unique( _parent, @@ -64,6 +66,9 @@ void Invoice::fillFromData(not_null invoice) { 0, int(statusText.text.size()) }); statusText.text += ' ' + labelText().toUpper(); + if (isCreditsCurrency) { + statusText = {}; + } _status.setMarkedText( st::defaultTextStyle, statusText,