Add internalLinkTypeRestorePurchases.
This commit is contained in:
parent
4e9c7ffbf2
commit
d4b59bda87
@ -3720,6 +3720,9 @@ internalLinkTypePublicChat chat_username:string = InternalLinkType;
|
|||||||
//-"This code can be used to allow someone to log in to your Telegram account. To confirm Telegram login, please go to Settings > Devices > Scan QR and scan the code" needs to be shown
|
//-"This code can be used to allow someone to log in to your Telegram account. To confirm Telegram login, please go to Settings > Devices > Scan QR and scan the code" needs to be shown
|
||||||
internalLinkTypeQrCodeAuthentication = InternalLinkType;
|
internalLinkTypeQrCodeAuthentication = InternalLinkType;
|
||||||
|
|
||||||
|
//@description The link forces restore of App Store purchases when opened. For official iOS application only
|
||||||
|
internalLinkTypeRestorePurchases = InternalLinkType;
|
||||||
|
|
||||||
//@description The link is a link to application settings
|
//@description The link is a link to application settings
|
||||||
internalLinkTypeSettings = InternalLinkType;
|
internalLinkTypeSettings = InternalLinkType;
|
||||||
|
|
||||||
|
@ -487,6 +487,12 @@ class LinkManager::InternalLinkQrCodeAuthentication final : public InternalLink
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class LinkManager::InternalLinkRestorePurchases final : public InternalLink {
|
||||||
|
td_api::object_ptr<td_api::InternalLinkType> get_internal_link_type_object() const final {
|
||||||
|
return td_api::make_object<td_api::internalLinkTypeRestorePurchases>();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
class LinkManager::InternalLinkSettings final : public InternalLink {
|
class LinkManager::InternalLinkSettings final : public InternalLink {
|
||||||
td_api::object_ptr<td_api::InternalLinkType> get_internal_link_type_object() const final {
|
td_api::object_ptr<td_api::InternalLinkType> get_internal_link_type_object() const final {
|
||||||
return td_api::make_object<td_api::internalLinkTypeSettings>();
|
return td_api::make_object<td_api::internalLinkTypeSettings>();
|
||||||
@ -1068,6 +1074,9 @@ unique_ptr<LinkManager::InternalLink> LinkManager::parse_tg_link_query(Slice que
|
|||||||
if (has_arg("token")) {
|
if (has_arg("token")) {
|
||||||
return td::make_unique<InternalLinkQrCodeAuthentication>();
|
return td::make_unique<InternalLinkQrCodeAuthentication>();
|
||||||
}
|
}
|
||||||
|
} else if (path.size() == 1 && path[0] == "restore_purchases") {
|
||||||
|
// restore_purchases
|
||||||
|
return td::make_unique<InternalLinkRestorePurchases>();
|
||||||
} else if (path.size() == 1 && path[0] == "passport") {
|
} else if (path.size() == 1 && path[0] == "passport") {
|
||||||
// passport?bot_id=<bot_user_id>&scope=<scope>&public_key=<public_key>&nonce=<nonce>
|
// passport?bot_id=<bot_user_id>&scope=<scope>&public_key=<public_key>&nonce=<nonce>
|
||||||
return get_internal_link_passport(query, url_query.args_);
|
return get_internal_link_passport(query, url_query.args_);
|
||||||
|
@ -112,6 +112,7 @@ class LinkManager final : public Actor {
|
|||||||
class InternalLinkProxy;
|
class InternalLinkProxy;
|
||||||
class InternalLinkPublicDialog;
|
class InternalLinkPublicDialog;
|
||||||
class InternalLinkQrCodeAuthentication;
|
class InternalLinkQrCodeAuthentication;
|
||||||
|
class InternalLinkRestorePurchases;
|
||||||
class InternalLinkSettings;
|
class InternalLinkSettings;
|
||||||
class InternalLinkStickerSet;
|
class InternalLinkStickerSet;
|
||||||
class InternalLinkTheme;
|
class InternalLinkTheme;
|
||||||
|
@ -201,6 +201,9 @@ TEST(Link, parse_internal_link) {
|
|||||||
auto qr_code_authentication = [] {
|
auto qr_code_authentication = [] {
|
||||||
return td::td_api::make_object<td::td_api::internalLinkTypeQrCodeAuthentication>();
|
return td::td_api::make_object<td::td_api::internalLinkTypeQrCodeAuthentication>();
|
||||||
};
|
};
|
||||||
|
auto restore_purchases = [] {
|
||||||
|
return td::td_api::make_object<td::td_api::internalLinkTypeRestorePurchases>();
|
||||||
|
};
|
||||||
auto settings = [] {
|
auto settings = [] {
|
||||||
return td::td_api::make_object<td::td_api::internalLinkTypeSettings>();
|
return td::td_api::make_object<td::td_api::internalLinkTypeSettings>();
|
||||||
};
|
};
|
||||||
@ -510,6 +513,14 @@ TEST(Link, parse_internal_link) {
|
|||||||
parse_internal_link("tg:login?token=abacaba", qr_code_authentication());
|
parse_internal_link("tg:login?token=abacaba", qr_code_authentication());
|
||||||
parse_internal_link("tg:login?token=", unknown_deep_link("tg://login?token="));
|
parse_internal_link("tg:login?token=", unknown_deep_link("tg://login?token="));
|
||||||
|
|
||||||
|
parse_internal_link("tg:restore_purchases?token=abacaba", restore_purchases());
|
||||||
|
parse_internal_link("tg:restore_purchases?#", restore_purchases());
|
||||||
|
parse_internal_link("tg:restore_purchases/?#", restore_purchases());
|
||||||
|
parse_internal_link("tg:restore_purchases", restore_purchases());
|
||||||
|
parse_internal_link("tg:restore_purchase", unknown_deep_link("tg://restore_purchase"));
|
||||||
|
parse_internal_link("tg:restore_purchasess", unknown_deep_link("tg://restore_purchasess"));
|
||||||
|
parse_internal_link("tg:restore_purchases/test?#", unknown_deep_link("tg://restore_purchases/test?"));
|
||||||
|
|
||||||
parse_internal_link("t.me/joinchat?invite=abcdef", nullptr);
|
parse_internal_link("t.me/joinchat?invite=abcdef", nullptr);
|
||||||
parse_internal_link("t.me/joinchat", nullptr);
|
parse_internal_link("t.me/joinchat", nullptr);
|
||||||
parse_internal_link("t.me/joinchat/", nullptr);
|
parse_internal_link("t.me/joinchat/", nullptr);
|
||||||
|
Loading…
Reference in New Issue
Block a user