Add separate chatEventForumTopicToggleIsClosed.

This commit is contained in:
levlam 2022-10-27 19:52:26 +03:00
parent eb559e3671
commit 431932eff2
3 changed files with 11 additions and 0 deletions

View File

@ -3018,6 +3018,9 @@ chatEventForumTopicCreated topic_info:forumTopicInfo = ChatEventAction;
//@description A forum topic was edited @old_topic_info Old information about the topic @new_topic_info New information about the topic
chatEventForumTopicEdited old_topic_info:forumTopicInfo new_topic_info:forumTopicInfo = ChatEventAction;
//@description A forum topic was closed or reopened @topic_info New information about the topic
chatEventForumTopicToggleIsClosed topic_info:forumTopicInfo = ChatEventAction;
//@description A forum topic was deleted @topic_info Information about the topic
chatEventForumTopicDeleted topic_info:forumTopicInfo = ChatEventAction;

View File

@ -377,6 +377,10 @@ static td_api::object_ptr<td_api::ChatEventAction> get_chat_event_action_object(
if (old_topic_info.is_empty() || new_topic_info.is_empty()) {
return nullptr;
}
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));
}
return td_api::make_object<td_api::chatEventForumTopicEdited>(old_topic_info.get_forum_topic_info_object(td),
new_topic_info.get_forum_topic_info_object(td));
}

View File

@ -59,6 +59,10 @@ class ForumTopicInfo {
return is_outgoing_;
}
bool is_closed() const {
return is_closed_;
}
bool apply_edited_data(const ForumTopicEditedData &edited_data);
td_api::object_ptr<td_api::forumTopicInfo> get_forum_topic_info_object(Td *td) const;