diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index c2df5e999..4c5afaf70 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -553,8 +553,8 @@ supergroupMembersFilterBots = SupergroupMembersFilter; //@member_limit Maximum number of members, which can join the chat using the link simultaneously; 0 if not limited //@member_count Number of chat members, which joined the chat using the link //@is_permanent True, if the link is permanent. Permanent invite link can't have expire date or usage limit. There is exactly one permanent invite link for each administrator with can_invite_users right at a given time -//@is_expired True, if the link is already expired @is_revoked True, if the link was revoked -chatInviteLink invite_link:string administrator_user_id:int32 date:int32 edit_date:int32 expire_date:int32 member_limit:int32 member_count:int32 is_permanent:Bool is_expired:Bool is_revoked:Bool = ChatInviteLink; +//@is_revoked True, if the link was revoked +chatInviteLink invite_link:string administrator_user_id:int32 date:int32 edit_date:int32 expire_date:int32 member_limit:int32 member_count:int32 is_permanent:Bool is_revoked:Bool = ChatInviteLink; //@description Contains a list of chat invite links @total_count Approximate total count of chat invite links found @invite_links List of invite links chatInviteLinks total_count:int32 invite_links:vector = ChatInviteLinks; diff --git a/td/generate/scheme/td_api.tlo b/td/generate/scheme/td_api.tlo index 1982210e3..ed8db895f 100644 Binary files a/td/generate/scheme/td_api.tlo and b/td/generate/scheme/td_api.tlo differ diff --git a/td/telegram/DialogInviteLink.cpp b/td/telegram/DialogInviteLink.cpp index f3aa83061..58bd468df 100644 --- a/td/telegram/DialogInviteLink.cpp +++ b/td/telegram/DialogInviteLink.cpp @@ -102,21 +102,6 @@ Slice DialogInviteLink::get_dialog_invite_link_hash(Slice invite_link) { return Slice(); } -bool DialogInviteLink::is_expired() const { - return (expire_date_ != 0 && G()->unix_time() >= expire_date_) || (usage_limit_ != 0 && usage_count_ >= usage_limit_); -} - -int32 DialogInviteLink::get_expire_time() const { - if (expire_date_ == 0) { - return 0; - } - if (usage_limit_ != 0 && usage_count_ >= usage_limit_) { - // already expired - return 0; - } - return td::max(expire_date_ - G()->unix_time(), 0); -} - td_api::object_ptr DialogInviteLink::get_chat_invite_link_object( const ContactsManager *contacts_manager) const { CHECK(contacts_manager != nullptr); @@ -126,7 +111,7 @@ td_api::object_ptr DialogInviteLink::get_chat_invite_lin return td_api::make_object( invite_link_, contacts_manager->get_user_id_object(administrator_user_id_, "get_chat_invite_link_object"), date_, - edit_date_, expire_date_, usage_limit_, usage_count_, is_permanent_, is_expired(), is_revoked_); + edit_date_, expire_date_, usage_limit_, usage_count_, is_permanent_, is_revoked_); } bool operator==(const DialogInviteLink &lhs, const DialogInviteLink &rhs) { diff --git a/td/telegram/DialogInviteLink.h b/td/telegram/DialogInviteLink.h index d4e35cdd3..e7bde6044 100644 --- a/td/telegram/DialogInviteLink.h +++ b/td/telegram/DialogInviteLink.h @@ -55,10 +55,6 @@ class DialogInviteLink { return is_permanent_; } - bool is_expired() const; - - int32 get_expire_time() const; - const string &get_invite_link() const { return invite_link_; }