Add td_api::chatEventPollStopped and td_api::chatEventPermissionsChanged.

GitOrigin-RevId: 2f8af49d048392649ce23040f590ec71bf15c061
This commit is contained in:
levlam 2019-03-20 23:13:11 +03:00
parent c636408a7a
commit 2a0f26d24e
3 changed files with 29 additions and 2 deletions

View File

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

Binary file not shown.

View File

@ -22115,6 +22115,13 @@ tl_object_ptr<td_api::ChatEventAction> MessagesManager::get_chat_event_action_ob
return make_tl_object<td_api::chatEventPhotoChanged>(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<telegram_api::channelAdminLogEventActionDefaultBannedRights>(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<td_api::chatEventPermissionsChanged>(old_permissions.get_chat_permissions_object(),
new_permissions.get_chat_permissions_object());
}
case telegram_api::channelAdminLogEventActionToggleInvites::ID: {
auto action = move_tl_object_as<telegram_api::channelAdminLogEventActionToggleInvites>(action_ptr);
return make_tl_object<td_api::chatEventInvitesToggled>(action->new_value_);
@ -22148,6 +22155,20 @@ tl_object_ptr<td_api::ChatEventAction> 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<telegram_api::channelAdminLogEventActionStopPoll>(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<td_api::chatEventPollStopped>(get_message_object(message.first, message.second.get()));
}
case telegram_api::channelAdminLogEventActionDeleteMessage::ID: {
auto action = move_tl_object_as<telegram_api::channelAdminLogEventActionDeleteMessage>(action_ptr);
auto message = create_message(