From 2a0f26d24e5c453391a747e423ad0ab571d3b446 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 20 Mar 2019 23:13:11 +0300 Subject: [PATCH] Add td_api::chatEventPollStopped and td_api::chatEventPermissionsChanged. GitOrigin-RevId: 2f8af49d048392649ce23040f590ec71bf15c061 --- td/generate/scheme/td_api.tl | 10 ++++++++-- td/generate/scheme/td_api.tlo | Bin 152660 -> 152904 bytes td/telegram/MessagesManager.cpp | 21 +++++++++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 10efcea8..0ae4e8c1 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -1785,6 +1785,9 @@ chatEventMessageEdited old_message:message new_message:message = ChatEventAction //@description A message was deleted @message Deleted message chatEventMessageDeleted message:message = ChatEventAction; +//@description A poll in a message was stopped @message The message with the poll +chatEventPollStopped message:message = ChatEventAction; + //@description A message was pinned @message Pinned message chatEventMessagePinned message:message = ChatEventAction; @@ -1809,6 +1812,9 @@ chatEventMemberRestricted user_id:int32 old_status:ChatMemberStatus new_status:C //@description The chat title was changed @old_title Previous chat title @new_title New chat title chatEventTitleChanged old_title:string new_title:string = ChatEventAction; +//@description The chat permissions was changed @old_permissions Previous chat permissions @new_permissions New chat permissions +chatEventPermissionsChanged old_permissions:chatPermissions new_permissions:chatPermissions = ChatEventAction; + //@description The chat description was changed @old_description Previous chat description @new_description New chat description chatEventDescriptionChanged old_description:string new_description:string = ChatEventAction; @@ -1818,8 +1824,8 @@ chatEventUsernameChanged old_username:string new_username:string = ChatEventActi //@description The chat photo was changed @old_photo Previous chat photo value; may be null @new_photo New chat photo value; may be null chatEventPhotoChanged old_photo:chatPhoto new_photo:chatPhoto = ChatEventAction; -//@description The anyone_can_invite setting of a supergroup chat was toggled @anyone_can_invite New value of anyone_can_invite -chatEventInvitesToggled anyone_can_invite:Bool = ChatEventAction; +//@description The can_invite_users permission of a supergroup chat was toggled @can_invite_users New value of can_invite_users permission +chatEventInvitesToggled can_invite_users:Bool = ChatEventAction; //@description The sign_messages setting of a channel was toggled @sign_messages New value of sign_messages chatEventSignMessagesToggled sign_messages:Bool = ChatEventAction; diff --git a/td/generate/scheme/td_api.tlo b/td/generate/scheme/td_api.tlo index 91482afe3f7fc54bdcedee3afe5695a5b6cab6a0..698f6440618144654b7b8edba85aa1c957020938 100644 GIT binary patch delta 609 zcmcbzg7d^G&J7+cqS{Vo7x|qt5=&gmQu9h2lS?x5^MogVWE9_A!jhrPcx>}sb$@vl zkgCZB?lurcfqMjmamHN(!jSoFU;t9X00md&xMH4mpD7nfhM63YpOX_@l3!4engUb< zHV>!?qFcuUVGKm1$3sT~q~_)^As>*DMb2zG9JXx-!TK(EXyBF<@KnJq>Ej8pX!-|x zCf&(zjie_Z@Z^Ac1tt}+ol$4<1uq|naEX@=m@yqySiu|WVju4aS9FiBFu%M}8sYKO zqTI~lVqmZq1A{p)Jv9a9F(#nLq@Uf_DZiJ$(llu@1&%*{(J2XoaSPFUd$al+&q z-U$#98y~1hjt^Aif)CU^e|#cL(cP0h&GnBs+&!LoWtkdse4$bE!`A|0r->ib&J@24h{y#$s1%RC3s|H%#J@enpK*DJKNBketOC#7 delta 466 zcmX@Hiu1|}&J7+cq9yA)Pw_ivB$l|ArRJ45CYNO9=Lt^!$SA(Kge60n@yO=8>i+U9 zAXSqM+-)F?0`~|APZcM}_(>?j z{LKiIkbZVwQ!p{FGCwahJ~=TjJ~OW@vt;tYjnKf|;Rg-DH+~inOEvtVmPYtzKtzuC YL!>4JxPS$kJp$T20vMNj1Te7z0HzYZ?*IS* diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 1f222bc9..03123c7d 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -22115,6 +22115,13 @@ tl_object_ptr MessagesManager::get_chat_event_action_ob return make_tl_object(get_chat_photo_object(file_manager, &old_photo), get_chat_photo_object(file_manager, &new_photo)); } + case telegram_api::channelAdminLogEventActionDefaultBannedRights::ID: { + auto action = move_tl_object_as(action_ptr); + auto old_permissions = get_restricted_rights(std::move(action->prev_banned_rights_)); + auto new_permissions = get_restricted_rights(std::move(action->new_banned_rights_)); + return make_tl_object(old_permissions.get_chat_permissions_object(), + new_permissions.get_chat_permissions_object()); + } case telegram_api::channelAdminLogEventActionToggleInvites::ID: { auto action = move_tl_object_as(action_ptr); return make_tl_object(action->new_value_); @@ -22148,6 +22155,20 @@ tl_object_ptr MessagesManager::get_chat_event_action_ob get_message_object(old_message.first, old_message.second.get()), get_message_object(new_message.first, new_message.second.get())); } + case telegram_api::channelAdminLogEventActionStopPoll::ID: { + auto action = move_tl_object_as(action_ptr); + auto message = create_message( + parse_telegram_api_message(std::move(action->message_), "channelAdminLogEventActionStopPoll"), true); + if (message.second == nullptr) { + LOG(ERROR) << "Failed to get stopped poll message"; + return nullptr; + } + if (message.second->content->get_type() != MessageContentType::Poll) { + LOG(ERROR) << "Receive not a poll in channelAdminLogEventActionStopPoll"; + return nullptr; + } + return make_tl_object(get_message_object(message.first, message.second.get())); + } case telegram_api::channelAdminLogEventActionDeleteMessage::ID: { auto action = move_tl_object_as(action_ptr); auto message = create_message(