Remove inviteLink.is_expired field.

This commit is contained in:
levlam 2021-02-05 03:04:16 +03:00
parent fef8bd151c
commit 9d9e093640
4 changed files with 3 additions and 22 deletions

View File

@ -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<chatInviteLink> = ChatInviteLinks;

Binary file not shown.

View File

@ -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<td_api::chatInviteLink> DialogInviteLink::get_chat_invite_link_object(
const ContactsManager *contacts_manager) const {
CHECK(contacts_manager != nullptr);
@ -126,7 +111,7 @@ td_api::object_ptr<td_api::chatInviteLink> DialogInviteLink::get_chat_invite_lin
return td_api::make_object<td_api::chatInviteLink>(
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) {

View File

@ -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_;
}