diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index d844b0ed..6f36c92a 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -3567,7 +3567,7 @@ createNewSecretChat user_id:int32 = Chat; upgradeBasicGroupChatToSupergroupChat chat_id:int53 = Chat; -//@description Moves a chat to a different chat list. Current chat list of the chat must ne non-null @chat_id Chat identifier @chat_list New chat list of the chat +//@description Moves a chat to a different chat list. Current chat list of the chat must ne non-null @chat_id Chat identifier @chat_list New chat list of the chat. The chat with the current user (Saved Messages) and the chat 777000 (Telegram) can't be moved to the Archive chat list setChatChatList chat_id:int53 chat_list:ChatList = Ok; //@description Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info rights. The title will not be changed until the request to the server has been completed diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index c3d11ab7..bb511a27 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -24749,6 +24749,12 @@ void MessagesManager::set_dialog_folder_id(DialogId dialog_id, FolderId folder_i return promise.set_value(Unit()); } + if (folder_id == FolderId::archive() && + (dialog_id == get_my_dialog_id() || + dialog_id == DialogId(td_->contacts_manager_->get_service_notifications_user_id()))) { + return promise.set_error(Status::Error(400, "Chat can't be archived")); + } + if (!have_input_peer(dialog_id, AccessRights::Read)) { return promise.set_error(Status::Error(6, "Can't access the chat")); }