mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-08-04 02:50:36 +00:00
Identify auctions by id instead of slug.
This commit is contained in:
@@ -34,6 +34,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "history/view/history_view_subsection_tabs.h"
|
||||
#include "media/player/media_player_instance.h"
|
||||
#include "media/view/media_view_open_common.h"
|
||||
#include "data/components/gift_auctions.h"
|
||||
#include "data/components/recent_peers.h"
|
||||
#include "data/stickers/data_custom_emoji.h"
|
||||
#include "data/data_document_resolver.h"
|
||||
@@ -3652,10 +3653,29 @@ void SessionController::dropSubsectionTabs() {
|
||||
|
||||
void SessionController::showStarGiftAuction(const QString &slug) {
|
||||
_starGiftAuctionLifetime.destroy();
|
||||
|
||||
const auto requesting = _starGiftAuctionLifetime.make_state<
|
||||
base::has_weak_ptr
|
||||
>();
|
||||
const auto guard = base::make_weak(requesting);
|
||||
const auto weak = base::make_weak(this);
|
||||
session().giftAuctions().resolveSlug(slug, [=](uint64 giftId) {
|
||||
if (!guard || !weak) {
|
||||
return;
|
||||
}
|
||||
_starGiftAuctionLifetime.destroy();
|
||||
if (giftId) {
|
||||
showStarGiftAuction(giftId);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void SessionController::showStarGiftAuction(uint64 giftId) {
|
||||
_starGiftAuctionLifetime.destroy();
|
||||
_starGiftAuctionLifetime = Ui::ShowStarGiftAuction(
|
||||
this,
|
||||
nullptr,
|
||||
slug,
|
||||
giftId,
|
||||
[] {},
|
||||
[=] { _starGiftAuctionLifetime.destroy(); });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user