Rename forum topic title to topic name.

This commit is contained in:
levlam 2022-11-02 17:31:25 +03:00
parent 4cc5ed345d
commit 5aaa20b4d9
3 changed files with 20 additions and 21 deletions

View File

@ -1310,13 +1310,13 @@ forumTopicIcon color:int32 custom_emoji_id:int64 = ForumTopicIcon;
//@description Contains basic information about a forum topic
//@message_thread_id Message thread identifier of the topic
//@title Title of the topic
//@name Name of the topic
//@icon Icon of the topic
//@creation_date Date the topic was created
//@creator_id Identifier of the creator of the topic
//@is_outgoing True, if the topic was created by the current user
//@is_closed True, if the topic is closed
forumTopicInfo message_thread_id:int53 title:string icon:forumTopicIcon creation_date:int32 creator_id:MessageSender is_outgoing:Bool is_closed:Bool = ForumTopicInfo;
forumTopicInfo message_thread_id:int53 name:string icon:forumTopicIcon creation_date:int32 creator_id:MessageSender is_outgoing:Bool is_closed:Bool = ForumTopicInfo;
//@description Describes a forum topic
//@info Basic information about the topic
@ -2093,11 +2093,11 @@ messageChatSetTheme theme_name:string = MessageContent;
//@description The TTL (Time To Live) setting for messages in the chat has been changed @ttl New message TTL
messageChatSetTtl ttl:int32 = MessageContent;
//@description A forum topic has been created @title Title of the topic @icon Icon of the topic
messageForumTopicCreated title:string icon:forumTopicIcon = MessageContent;
//@description A forum topic has been created @name Name of the topic @icon Icon of the topic
messageForumTopicCreated name:string icon:forumTopicIcon = MessageContent;
//@description A forum topic has been edited @title If non-empty, the new title of the topic @edit_icon_custom_emoji_id True, if icon's custom_emoji_id is changed @icon_custom_emoji_id New unique identifier of the custom emoji shown on the topic icon; 0 if none. Must be ignored if edit_icon_custom_emoji_id is false
messageForumTopicEdited title:string edit_icon_custom_emoji_id:Bool icon_custom_emoji_id:int64 = MessageContent;
//@description A forum topic has been edited @name If non-empty, the new name of the topic @edit_icon_custom_emoji_id True, if icon's custom_emoji_id is changed @icon_custom_emoji_id New unique identifier of the custom emoji shown on the topic icon; 0 if none. Must be ignored if edit_icon_custom_emoji_id is false
messageForumTopicEdited name:string edit_icon_custom_emoji_id:Bool icon_custom_emoji_id:int64 = MessageContent;
//@description A forum topic has been closed or opened @is_closed True if the topic was closed or reopened
messageForumTopicIsClosedToggled is_closed:Bool = MessageContent;
@ -5298,16 +5298,16 @@ getForumTopicDefaultIcons = Stickers;
//@description Creates a topic in a forum supergroup chat; requires can_manage_topics rights in the supergroup
//@chat_id Identifier of the chat
//@title Title of the topic
//@name Name of the topic; 1-128 characters
//@icon Icon of the topic. Icon color must be one of 0x6FB9F0, 0xFFD67E, 0xCB86DB, 0x8EEE98, 0xFF93B2, or 0xFB6F5F. Telegram Premium users can use any custom emoji as topic icon, other users can use only a custom emoji returned by getForumTopicDefaultIcons
createForumTopic chat_id:int53 title:string icon:forumTopicIcon = ForumTopicInfo;
createForumTopic chat_id:int53 name:string icon:forumTopicIcon = ForumTopicInfo;
//@description Edits title and icon of a topic in a forum supergroup chat; requires can_manage_topics administrator rights in the supergroup unless the user is creator of the topic
//@chat_id Identifier of the chat
//@message_thread_id Message thread identifier of the forum topic
//@title New title of the topic
//@name New name of the topic; 1-128 characters
//@icon_custom_emoji_id Identifier of the new custom emoji for topic icon. Telegram Premium users can use any custom emoji, other users can use only a custom emoji returned by getForumTopicDefaultIcons
editForumTopic chat_id:int53 message_thread_id:int53 title:string icon_custom_emoji_id:int64 = Ok;
editForumTopic chat_id:int53 message_thread_id:int53 name:string icon_custom_emoji_id:int64 = Ok;
//@description Toggles is_closed state of a topic in a forum supergroup chat; requires can_manage_topics administrator rights in the supergroup unless the user is creator of the topic
//@chat_id Identifier of the chat

View File

@ -5533,17 +5533,17 @@ void Td::on_request(uint64 id, const td_api::getForumTopicDefaultIcons &request)
}
void Td::on_request(uint64 id, td_api::createForumTopic &request) {
CLEAN_INPUT_STRING(request.title_);
CLEAN_INPUT_STRING(request.name_);
CREATE_REQUEST_PROMISE();
forum_topic_manager_->create_forum_topic(DialogId(request.chat_id_), std::move(request.title_),
forum_topic_manager_->create_forum_topic(DialogId(request.chat_id_), std::move(request.name_),
std::move(request.icon_), std::move(promise));
}
void Td::on_request(uint64 id, td_api::editForumTopic &request) {
CLEAN_INPUT_STRING(request.title_);
CLEAN_INPUT_STRING(request.name_);
CREATE_OK_REQUEST_PROMISE();
forum_topic_manager_->edit_forum_topic(DialogId(request.chat_id_), MessageId(request.message_thread_id_),
std::move(request.title_), CustomEmojiId(request.icon_custom_emoji_id_),
std::move(request.name_), CustomEmojiId(request.icon_custom_emoji_id_),
std::move(promise));
}

View File

@ -3858,19 +3858,18 @@ class CliClient final : public Actor {
send_request(td_api::make_object<td_api::getForumTopicDefaultIcons>());
} else if (op == "cft") {
ChatId chat_id;
string title;
string name;
int32 icon_color;
get_args(args, chat_id, title, icon_color);
get_args(args, chat_id, name, icon_color);
send_request(td_api::make_object<td_api::createForumTopic>(
chat_id, title, td_api::make_object<td_api::forumTopicIcon>(icon_color, 0)));
chat_id, name, td_api::make_object<td_api::forumTopicIcon>(icon_color, 0)));
} else if (op == "eft") {
ChatId chat_id;
MessageThreadId message_thread_id;
string title;
string name;
int64 icon_custom_emoji_id;
get_args(args, chat_id, message_thread_id, title, icon_custom_emoji_id);
send_request(
td_api::make_object<td_api::editForumTopic>(chat_id, message_thread_id, title, icon_custom_emoji_id));
get_args(args, chat_id, message_thread_id, name, icon_custom_emoji_id);
send_request(td_api::make_object<td_api::editForumTopic>(chat_id, message_thread_id, name, icon_custom_emoji_id));
} else if (op == "tftic") {
ChatId chat_id;
MessageThreadId message_thread_id;