Add chatEventForumTopicToggleIsHidden.

This commit is contained in:
levlam 2022-11-30 16:11:37 +03:00
parent f6e8e85547
commit 7c4ec3cffa
2 changed files with 9 additions and 0 deletions

View File

@ -3031,6 +3031,9 @@ chatEventForumTopicEdited old_topic_info:forumTopicInfo new_topic_info:forumTopi
//@description A forum topic was closed or reopened @topic_info New information about the topic
chatEventForumTopicToggleIsClosed topic_info:forumTopicInfo = ChatEventAction;
//@description The General forum topic was hidden or unhidden @topic_info New information about the topic
chatEventForumTopicToggleIsHidden topic_info:forumTopicInfo = ChatEventAction;
//@description A forum topic was deleted @topic_info Information about the topic
chatEventForumTopicDeleted topic_info:forumTopicInfo = ChatEventAction;

View File

@ -380,6 +380,12 @@ static td_api::object_ptr<td_api::ChatEventAction> get_chat_event_action_object(
LOG(ERROR) << "Receive " << to_string(action);
return nullptr;
}
bool edit_is_closed = old_topic_info.is_closed() != new_topic_info.is_closed();
bool edit_is_hidden = old_topic_info.is_hidden() != new_topic_info.is_hidden();
if (edit_is_hidden && !(!new_topic_info.is_hidden() && edit_is_closed && !new_topic_info.is_closed())) {
return td_api::make_object<td_api::chatEventForumTopicToggleIsHidden>(
new_topic_info.get_forum_topic_info_object(td));
}
if (old_topic_info.is_closed() != new_topic_info.is_closed()) {
return td_api::make_object<td_api::chatEventForumTopicToggleIsClosed>(
new_topic_info.get_forum_topic_info_object(td));