Skip to content

Commit

Permalink
f Update TDLib to 1.8.18 and fix the build.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Oct 23, 2024
1 parent a6239a7 commit 618e7f5
Showing 1 changed file with 42 additions and 6 deletions.
48 changes: 42 additions & 6 deletions Telegram/SourceFiles/core/local_url_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1728,15 +1728,15 @@ bool HandleLocalUrl(
.openWebAppUrl = openWebAppUrl,
}));
});
}, [&](const TLDinternalLinkTypeSideMenuBot &data) {
}, [&](const TLDinternalLinkTypeMainWebApp &data) {
if (!controller) {
return false;
}
// todo
controller->showPeerByLink(Window::PeerByLinkInfo{
.usernameOrId = data.vbot_username().v,
.attachBotToggleCommand = data.vurl().v,
//.attachBotMenuOpen = true,
.attachBotToggleCommand = data.vstart_parameter().v,
.attachBotMainOpen = true,
.attachBotMainCompact = data.vis_compact().v,
.clickFromMessageId = my.itemId,
});
controller->window().activate();
Expand Down Expand Up @@ -2145,10 +2145,46 @@ bool HandleLocalUrl(
if (!controller) {
return false;
}
const auto ref = data.vreferrer().v;
controller->showGiftPremiumsBox(ref.isEmpty() ? u"gift_url"_q : ref);
Ui::ChooseStarGiftRecipient(controller);
controller->window().activate();
return true;
}, [&](const TLDinternalLinkTypeBuyStars &data) {
if (!controller) {
return false;
}
const auto amount = std::clamp(
data.vstar_count().v,
int64(1),
int64(1'000'000));
const auto purpose = data.vpurpose().v;
const auto weak = base::make_weak(controller);
const auto done = [=](::Settings::SmallBalanceResult result) {
if (result == ::Settings::SmallBalanceResult::Already) {
if (const auto strong = weak.get()) {
const auto filter = [=](const auto &...) {
strong->showSettings(::Settings::CreditsId());
return false;
};
strong->showToast(Ui::Toast::Config{
.text = tr::lng_credits_enough(
tr::now,
lt_link,
Ui::Text::Link(
Ui::Text::Bold(
tr::lng_credits_enough_link(tr::now))),
Ui::Text::RichLangValue),
.filter = filter,
.duration = 4 * crl::time(1000),
});
}
}
};
::Settings::MaybeRequestBalanceIncrease(
controller->uiShow(),
amount,
::Settings::SmallBalanceDeepLink{ .purpose = purpose },
done);
return true;
});
}

Expand Down

0 comments on commit 618e7f5

Please sign in to comment.