diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index ca4d3a495..88f16ee55 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -1262,8 +1262,9 @@ inviteLinkChatTypeChannel = InviteLinkChatType; //@description Contains information about subscription plan that must be paid by the user to use a chat invite link //@pricing Information about subscription plan that must be paid by the user to use the link +//@can_reuse True, if the user has already paid for the subscription and can use the link to join the subscribed chat again //@form_id Identifier of the payment form to use for subscription payment; 0 if the subscription can't be paid -chatInviteLinkSubscriptionInfo pricing:starSubscriptionPricing form_id:int64 = ChatInviteLinkSubscriptionInfo; +chatInviteLinkSubscriptionInfo pricing:starSubscriptionPricing can_reuse:Bool form_id:int64 = ChatInviteLinkSubscriptionInfo; //@description Contains information about a chat invite link //@chat_id Chat identifier of the invite link; 0 if the user has no access to the chat before joining diff --git a/td/telegram/DialogInviteLinkManager.cpp b/td/telegram/DialogInviteLinkManager.cpp index 82fb78dec..42be39cde 100644 --- a/td/telegram/DialogInviteLinkManager.cpp +++ b/td/telegram/DialogInviteLinkManager.cpp @@ -736,6 +736,7 @@ void DialogInviteLinkManager::on_get_dialog_invite_link_info( invite_link_info->participant_user_ids = std::move(participant_user_ids); invite_link_info->subscription_pricing = StarSubscriptionPricing(std::move(chat_invite->subscription_pricing_)); invite_link_info->subscription_form_id = chat_invite->subscription_form_id_; + invite_link_info->can_refulfill_subscription = chat_invite->can_refulfill_subscription_; invite_link_info->creates_join_request = std::move(chat_invite->request_needed_); invite_link_info->is_chat = !chat_invite->channel_; invite_link_info->is_channel = chat_invite->channel_; @@ -844,7 +845,8 @@ td_api::object_ptr DialogInviteLinkManager::get_chat auto subscription_pricing = invite_link_info->subscription_pricing.get_star_subscription_pricing_object(); if (subscription_pricing != nullptr) { subscription_info = td_api::make_object( - std::move(subscription_pricing), invite_link_info->subscription_form_id); + std::move(subscription_pricing), invite_link_info->can_refulfill_subscription, + invite_link_info->subscription_form_id); } creates_join_request = invite_link_info->creates_join_request; is_public = invite_link_info->is_public; diff --git a/td/telegram/DialogInviteLinkManager.h b/td/telegram/DialogInviteLinkManager.h index ca2556563..bcc522e79 100644 --- a/td/telegram/DialogInviteLinkManager.h +++ b/td/telegram/DialogInviteLinkManager.h @@ -117,6 +117,7 @@ class DialogInviteLinkManager final : public Actor { StarSubscriptionPricing subscription_pricing; int64 subscription_form_id; bool creates_join_request = false; + bool can_refulfill_subscription = false; bool is_chat = false; bool is_channel = false; bool is_public = false;