Handle auction links.

This commit is contained in:
John Preston
2025-11-14 14:40:25 +04:00
parent 4a5cdbcfb2
commit e43830c08e
5 changed files with 70 additions and 12 deletions

View File

@@ -8,11 +8,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "window/window_session_controller.h"
#include "api/api_text_entities.h"
#include "boxes/add_contact_box.h"
#include "boxes/peers/add_bot_to_chat_box.h"
#include "boxes/peers/edit_peer_info_box.h"
#include "boxes/peers/replace_boost_box.h"
#include "boxes/add_contact_box.h"
#include "boxes/delete_messages_box.h"
#include "boxes/star_gift_auction_box.h"
#include "window/window_chat_preview.h"
#include "window/window_chat_switch_process.h"
#include "window/window_controller.h"
@@ -3639,6 +3640,16 @@ void SessionController::dropSubsectionTabs() {
base::take(_savedSubsectionTabs);
}
void SessionController::showStarGiftAuction(const QString &slug) {
_starGiftAuctionLifetime.destroy();
_starGiftAuctionLifetime = Ui::ShowStarGiftAuction(
this,
nullptr,
slug,
[] {},
[=] { _starGiftAuctionLifetime.destroy(); });
}
SessionController::~SessionController() {
resetFakeUnreadWhileOpened();
dropSubsectionTabs();

View File

@@ -696,6 +696,8 @@ public:
-> std::unique_ptr<HistoryView::SubsectionTabs>;
void dropSubsectionTabs();
void showStarGiftAuction(const QString &slug);
[[nodiscard]] rpl::lifetime &lifetime() {
return _lifetime;
}
@@ -815,6 +817,8 @@ private:
std::unique_ptr<HistoryView::SubsectionTabs> _savedSubsectionTabs;
rpl::lifetime _savedSubsectionTabsLifetime;
rpl::lifetime _starGiftAuctionLifetime;
rpl::lifetime _lifetime;
};