From 605a968e519f505434df21663e92ccdbb81958d1 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 28 Sep 2020 01:15:56 +0300 Subject: [PATCH] Change is_anonymous field position. GitOrigin-RevId: 7676dd1916881f24eba79f5692986b2d213b9a73 --- td/generate/scheme/td_api.tl | 8 ++++---- td/generate/scheme/td_api.tlo | Bin 182748 -> 182748 bytes td/telegram/DialogParticipant.cpp | 8 ++++---- td/telegram/Td.cpp | 2 +- td/telegram/cli.cpp | 23 +++++++++++++---------- 5 files changed, 22 insertions(+), 19 deletions(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 94631f8fd..67b3c24af 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -440,13 +440,12 @@ chatPermissions can_send_messages:Bool can_send_media_messages:Bool can_send_pol //@class ChatMemberStatus @description Provides information about the status of a member in a chat //@description The user is the owner of a chat and has all the administrator privileges -//@is_anonymous True, if the creator isn't shown in the chat member list and sends messages anonymously //@custom_title A custom title of the owner; 0-16 characters without emojis; applicable to supergroups only +//@is_anonymous True, if the creator isn't shown in the chat member list and sends messages anonymously //@is_member True, if the user is a member of the chat -chatMemberStatusCreator is_anonymous:Bool custom_title:string is_member:Bool = ChatMemberStatus; +chatMemberStatusCreator custom_title:string is_anonymous:Bool is_member:Bool = ChatMemberStatus; //@description The user is a member of a chat and has some additional privileges. In basic groups, administrators can edit and delete messages sent by others, add new members, and ban unprivileged members. In supergroups and channels, there are more detailed options for administrator privileges -//@is_anonymous True, if the administrator isn't shown in the chat member list and sends messages anonymously //@custom_title A custom title of the administrator; 0-16 characters without emojis; applicable to supergroups only //@can_be_edited True, if the current user can edit the administrator privileges for the called user //@can_change_info True, if the administrator can change the chat title, photo, and other settings @@ -457,7 +456,8 @@ chatMemberStatusCreator is_anonymous:Bool custom_title:string is_member:Bool = C //@can_restrict_members True, if the administrator can restrict, ban, or unban chat members //@can_pin_messages True, if the administrator can pin messages; applicable to groups only //@can_promote_members True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them -chatMemberStatusAdministrator is_anonymous:Bool custom_title:string can_be_edited:Bool can_change_info:Bool can_post_messages:Bool can_edit_messages:Bool can_delete_messages:Bool can_invite_users:Bool can_restrict_members:Bool can_pin_messages:Bool can_promote_members:Bool = ChatMemberStatus; +//@is_anonymous True, if the administrator isn't shown in the chat member list and sends messages anonymously +chatMemberStatusAdministrator custom_title:string can_be_edited:Bool can_change_info:Bool can_post_messages:Bool can_edit_messages:Bool can_delete_messages:Bool can_invite_users:Bool can_restrict_members:Bool can_pin_messages:Bool can_promote_members:Bool is_anonymous:Bool = ChatMemberStatus; //@description The user is a member of a chat, without any additional privileges or restrictions chatMemberStatusMember = ChatMemberStatus; diff --git a/td/generate/scheme/td_api.tlo b/td/generate/scheme/td_api.tlo index cb16f7c04ef660bef2e5fcfaef2bf641c298abb2..e8b44f1484a537d272facd94de2821cf61567467 100644 GIT binary patch delta 338 zcmcaJnfuOU?hQ9MSdO~vJ+b)?#~Et~YmG~Z0xL+2VKQU7{A8EZ1hDwz6{*O=Z&FjR z2ydQ|CL;h5-%;km^3SX6+oW;{PLOFgj|urOPd=NVKiT1##&m-UMwZDnbFub+YVIW);FnI1ENT$+6K&M&Z*v>Q_ZNL1?II+SjxD4 X!cwLkjF2#z{%|>y!uH(dO!-Ox@*j DialogParticipantStatus::get_chat_member_status_object() const { switch (type_) { case Type::Creator: - return td_api::make_object(is_anonymous(), rank_, is_member()); + return td_api::make_object(rank_, is_anonymous(), is_member()); case Type::Administrator: return td_api::make_object( - is_anonymous(), rank_, can_be_edited(), can_change_info_and_settings(), can_post_messages(), - can_edit_messages(), can_delete_messages(), can_invite_users(), can_restrict_members(), can_pin_messages(), - can_promote_members()); + rank_, can_be_edited(), can_change_info_and_settings(), can_post_messages(), can_edit_messages(), + can_delete_messages(), can_invite_users(), can_restrict_members(), can_pin_messages(), can_promote_members(), + is_anonymous()); case Type::Member: return td_api::make_object(); case Type::Restricted: diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index 735494705..a287cd18c 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -6117,7 +6117,7 @@ void Td::on_request(uint64 id, const td_api::leaveChat &request) { } new_status = - td_api::make_object(status.is_anonymous(), status.get_rank(), false); + td_api::make_object(status.get_rank(), status.is_anonymous(), false); } } messages_manager_->set_dialog_participant_status(dialog_id, contacts_manager_->get_my_id(), std::move(new_status), diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index bea9f2f40..9cadf07e3 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -3756,25 +3756,28 @@ class CliClient final : public Actor { } else if (status_str == "banned") { status = td_api::make_object(std::numeric_limits::max()); } else if (status_str == "creator") { - status = td_api::make_object(false, "", true); + status = td_api::make_object("", false, true); } else if (status_str == "creatoranon") { - status = td_api::make_object(true, "", true); + status = td_api::make_object("", true, true); } else if (status_str == "uncreator") { - status = td_api::make_object(false, "", false); + status = td_api::make_object("", false, false); } else if (status_str == "anon") { - status = td_api::make_object(true, "anon", true, true, true, true, true, + status = td_api::make_object("anon", true, true, true, true, true, true, true, true, true, true); + } else if (status_str == "anonadmin") { + status = td_api::make_object("anon", false, false, false, false, false, + false, false, false, false, true); } else if (status_str == "admin") { - status = td_api::make_object(false, "", true, true, true, true, true, - true, true, true, true); + status = td_api::make_object("", true, true, true, true, true, true, + true, true, true, false); } else if (status_str == "adminq") { - status = td_api::make_object(false, "title", true, true, true, true, - true, true, true, true, true); + status = td_api::make_object("title", true, true, true, true, true, true, + true, true, true, false); } else if (status_str == "minadmin") { - status = td_api::make_object(false, "", true, true, false, false, false, + status = td_api::make_object("", true, true, false, false, false, false, false, false, false, false); } else if (status_str == "unadmin") { - status = td_api::make_object(false, "", true, false, false, false, false, + status = td_api::make_object("", true, false, false, false, false, false, false, false, false, false); } else if (status_str == "rest") { status = td_api::make_object(