2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Added ability to cancel and renew subscription from settings section.

This commit is contained in:
23rd
2024-08-10 01:22:32 +03:00
committed by John Preston
parent 32e8ed93e2
commit 4f7364b798
3 changed files with 71 additions and 4 deletions

View File

@@ -342,7 +342,8 @@ void ConfirmSubscriptionBox(
void CheckChatInvite(
not_null<Window::SessionController*> controller,
const QString &hash,
ChannelData *invitePeekChannel) {
ChannelData *invitePeekChannel,
Fn<void()> loaded) {
const auto session = &controller->session();
const auto weak = base::make_weak(controller);
session->api().checkChatInvite(hash, [=](const MTPChatInvite &result) {
@@ -350,6 +351,9 @@ void CheckChatInvite(
if (!strong) {
return;
}
if (loaded) {
loaded();
}
Core::App().hideMediaView();
const auto show = [&](not_null<PeerData*> chat) {
const auto way = Window::SectionShow::Way::Forward;

View File

@@ -38,7 +38,8 @@ namespace Api {
void CheckChatInvite(
not_null<Window::SessionController*> controller,
const QString &hash,
ChannelData *invitePeekChannel = nullptr);
ChannelData *invitePeekChannel = nullptr,
Fn<void()> loaded = nullptr);
} // namespace Api