mirror of
https://github.com/Qz3rK/tdesktop.git
synced 2026-07-03 14:15:08 +02:00
Auto-submit /start when paying for premium.
This commit is contained in:
@@ -598,7 +598,12 @@ void StartPremiumPayment(
|
||||
"premium_invoice_slug",
|
||||
QString());
|
||||
if (!username.isEmpty()) {
|
||||
UrlClickHandler::Open("https://t.me/" + username + "?start=" + ref);
|
||||
controller->showPeerByLink(Window::SessionNavigation::PeerByLinkInfo{
|
||||
.usernameOrId = username,
|
||||
.resolveType = Window::ResolveType::BotStart,
|
||||
.startToken = ref,
|
||||
.startAutoSubmit = true,
|
||||
});
|
||||
} else if (!slug.isEmpty()) {
|
||||
UrlClickHandler::Open("https://t.me/$" + slug);
|
||||
}
|
||||
|
||||
@@ -346,6 +346,8 @@ void SessionNavigation::showPeerByLinkResolved(
|
||||
// Show specific posts only in channels / supergroups.
|
||||
const auto msgId = peer->isChannel()
|
||||
? info.messageId
|
||||
: info.startAutoSubmit
|
||||
? ShowAndStartBotMsgId
|
||||
: ShowAtUnreadMsgId;
|
||||
const auto attachBotUsername = info.attachBotUsername;
|
||||
if (bot && bot->botInfo->startToken != info.startToken) {
|
||||
|
||||
@@ -193,6 +193,7 @@ public:
|
||||
ResolveType resolveType = ResolveType::Default;
|
||||
QString startToken;
|
||||
ChatAdminRights startAdminRights;
|
||||
bool startAutoSubmit = false;
|
||||
QString attachBotUsername;
|
||||
std::optional<QString> attachBotToggleCommand;
|
||||
std::optional<QString> voicechatHash;
|
||||
|
||||
Reference in New Issue
Block a user