Add td_api::hideChatFolderNewChats.
This commit is contained in:
parent
758926bbed
commit
f431c8ba5a
@ -6847,12 +6847,15 @@ checkChatFolderInviteLink invite_link:string = ChatFolderInviteLinkInfo;
|
|||||||
//@description Adds a chat folder by an invite link @invite_link Invite link for the chat folder @chat_ids Identifiers of the chats added to the chat folder. The chats are automatically joined if they aren't joined yet
|
//@description Adds a chat folder by an invite link @invite_link Invite link for the chat folder @chat_ids Identifiers of the chats added to the chat folder. The chats are automatically joined if they aren't joined yet
|
||||||
addChatFolderByInviteLink invite_link:string chat_ids:vector<int53> = Ok;
|
addChatFolderByInviteLink invite_link:string chat_ids:vector<int53> = Ok;
|
||||||
|
|
||||||
//@description Returns new chats added to a shareable chat folder by its owner. The method should be called at most once an hour for the given chat folder @chat_folder_id Chat folder identifier
|
//@description Returns new chats added to a shareable chat folder by its owner. The method should be called at most once in five minutes for the given chat folder @chat_folder_id Chat folder identifier
|
||||||
getChatFolderNewChats chat_folder_id:int32 = Chats;
|
getChatFolderNewChats chat_folder_id:int32 = Chats;
|
||||||
|
|
||||||
//@description Adds new chats added to a shareable chat folder by its owner to the user's chat folder @chat_folder_id Chat folder identifier @chat_ids Identifiers of the new chats added to the chat folder. The chats are automatically joined if they aren't joined yet
|
//@description Adds new chats added to a shareable chat folder by its owner to the user's chat folder @chat_folder_id Chat folder identifier @chat_ids Identifiers of the new chats added to the chat folder. The chats are automatically joined if they aren't joined yet
|
||||||
addChatFolderNewChats chat_folder_id:int32 chat_ids:vector<int53> = Ok;
|
addChatFolderNewChats chat_folder_id:int32 chat_ids:vector<int53> = Ok;
|
||||||
|
|
||||||
|
//@description Hides new chats added to a shareable chat folder by its owner, so they aren't received next time @chat_folder_id Chat folder identifier
|
||||||
|
hideChatFolderNewChats chat_folder_id:int32 = Ok;
|
||||||
|
|
||||||
|
|
||||||
//@description Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info administrator right
|
//@description Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info administrator right
|
||||||
//@chat_id Chat identifier
|
//@chat_id Chat identifier
|
||||||
|
@ -430,6 +430,34 @@ class JoinChatlistUpdatesQuery final : public Td::ResultHandler {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class HideChatlistUpdatesQuery final : public Td::ResultHandler {
|
||||||
|
Promise<Unit> promise_;
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit HideChatlistUpdatesQuery(Promise<Unit> &&promise) : promise_(std::move(promise)) {
|
||||||
|
}
|
||||||
|
|
||||||
|
void send(DialogFilterId dialog_filter_id) {
|
||||||
|
send_query(G()->net_query_creator().create(
|
||||||
|
telegram_api::chatlists_hideChatlistUpdates(dialog_filter_id.get_input_chatlist())));
|
||||||
|
}
|
||||||
|
|
||||||
|
void on_result(BufferSlice packet) final {
|
||||||
|
auto result_ptr = fetch_result<telegram_api::chatlists_hideChatlistUpdates>(packet);
|
||||||
|
if (result_ptr.is_error()) {
|
||||||
|
return on_error(result_ptr.move_as_error());
|
||||||
|
}
|
||||||
|
|
||||||
|
auto ptr = result_ptr.move_as_ok();
|
||||||
|
LOG(INFO) << "Receive result for HideChatlistUpdatesQuery: " << ptr;
|
||||||
|
promise_.set_value(Unit());
|
||||||
|
}
|
||||||
|
|
||||||
|
void on_error(Status status) final {
|
||||||
|
promise_.set_error(std::move(status));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
class GetDialogsQuery final : public Td::ResultHandler {
|
class GetDialogsQuery final : public Td::ResultHandler {
|
||||||
Promise<Unit> promise_;
|
Promise<Unit> promise_;
|
||||||
bool is_single_ = false;
|
bool is_single_ = false;
|
||||||
@ -1983,6 +2011,18 @@ void DialogFilterManager::add_dialog_filter_new_chats(DialogFilterId dialog_filt
|
|||||||
td_->create_handler<JoinChatlistUpdatesQuery>(std::move(promise))->send(dialog_filter_id, std::move(dialog_ids));
|
td_->create_handler<JoinChatlistUpdatesQuery>(std::move(promise))->send(dialog_filter_id, std::move(dialog_ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DialogFilterManager::hide_dialog_filter_new_chats(DialogFilterId dialog_filter_id, Promise<Unit> &&promise) {
|
||||||
|
auto dialog_filter = get_dialog_filter(dialog_filter_id);
|
||||||
|
if (dialog_filter == nullptr) {
|
||||||
|
return promise.set_error(Status::Error(400, "Chat folder not found"));
|
||||||
|
}
|
||||||
|
if (!dialog_filter->is_shareable()) {
|
||||||
|
return promise.set_error(Status::Error(400, "Chat folder must be shareable"));
|
||||||
|
}
|
||||||
|
|
||||||
|
td_->create_handler<HideChatlistUpdatesQuery>(std::move(promise))->send(dialog_filter_id);
|
||||||
|
}
|
||||||
|
|
||||||
void DialogFilterManager::set_dialog_filter_has_my_invite_links(DialogFilterId dialog_filter_id,
|
void DialogFilterManager::set_dialog_filter_has_my_invite_links(DialogFilterId dialog_filter_id,
|
||||||
bool has_my_invite_links) {
|
bool has_my_invite_links) {
|
||||||
auto dialog_filter = get_dialog_filter(dialog_filter_id);
|
auto dialog_filter = get_dialog_filter(dialog_filter_id);
|
||||||
|
@ -105,6 +105,8 @@ class DialogFilterManager final : public Actor {
|
|||||||
void add_dialog_filter_new_chats(DialogFilterId dialog_filter_id, vector<DialogId> dialog_ids,
|
void add_dialog_filter_new_chats(DialogFilterId dialog_filter_id, vector<DialogId> dialog_ids,
|
||||||
Promise<Unit> &&promise);
|
Promise<Unit> &&promise);
|
||||||
|
|
||||||
|
void hide_dialog_filter_new_chats(DialogFilterId dialog_filter_id, Promise<Unit> &&promise);
|
||||||
|
|
||||||
void on_get_dialog_filter(telegram_api::object_ptr<telegram_api::DialogFilter> filter);
|
void on_get_dialog_filter(telegram_api::object_ptr<telegram_api::DialogFilter> filter);
|
||||||
|
|
||||||
void get_recommended_dialog_filters(Promise<td_api::object_ptr<td_api::recommendedChatFolders>> &&promise);
|
void get_recommended_dialog_filters(Promise<td_api::object_ptr<td_api::recommendedChatFolders>> &&promise);
|
||||||
|
@ -6221,6 +6221,12 @@ void Td::on_request(uint64 id, const td_api::addChatFolderNewChats &request) {
|
|||||||
DialogId::get_dialog_ids(request.chat_ids_), std::move(promise));
|
DialogId::get_dialog_ids(request.chat_ids_), std::move(promise));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Td::on_request(uint64 id, const td_api::hideChatFolderNewChats &request) {
|
||||||
|
CHECK_IS_USER();
|
||||||
|
CREATE_OK_REQUEST_PROMISE();
|
||||||
|
dialog_filter_manager_->hide_dialog_filter_new_chats(DialogFilterId(request.chat_folder_id_), std::move(promise));
|
||||||
|
}
|
||||||
|
|
||||||
void Td::on_request(uint64 id, td_api::setChatTitle &request) {
|
void Td::on_request(uint64 id, td_api::setChatTitle &request) {
|
||||||
CLEAN_INPUT_STRING(request.title_);
|
CLEAN_INPUT_STRING(request.title_);
|
||||||
CREATE_OK_REQUEST_PROMISE();
|
CREATE_OK_REQUEST_PROMISE();
|
||||||
|
@ -943,6 +943,8 @@ class Td final : public Actor {
|
|||||||
|
|
||||||
void on_request(uint64 id, const td_api::addChatFolderNewChats &request);
|
void on_request(uint64 id, const td_api::addChatFolderNewChats &request);
|
||||||
|
|
||||||
|
void on_request(uint64 id, const td_api::hideChatFolderNewChats &request);
|
||||||
|
|
||||||
void on_request(uint64 id, td_api::setChatTitle &request);
|
void on_request(uint64 id, td_api::setChatTitle &request);
|
||||||
|
|
||||||
void on_request(uint64 id, const td_api::setChatPhoto &request);
|
void on_request(uint64 id, const td_api::setChatPhoto &request);
|
||||||
|
@ -4631,6 +4631,10 @@ class CliClient final : public Actor {
|
|||||||
string chat_ids;
|
string chat_ids;
|
||||||
get_args(args, chat_folder_id, chat_ids);
|
get_args(args, chat_folder_id, chat_ids);
|
||||||
send_request(td_api::make_object<td_api::addChatFolderNewChats>(chat_folder_id, as_chat_ids(chat_ids)));
|
send_request(td_api::make_object<td_api::addChatFolderNewChats>(chat_folder_id, as_chat_ids(chat_ids)));
|
||||||
|
} else if (op == "hcfnc") {
|
||||||
|
ChatFolderId chat_folder_id;
|
||||||
|
get_args(args, chat_folder_id);
|
||||||
|
send_request(td_api::make_object<td_api::hideChatFolderNewChats>(chat_folder_id));
|
||||||
} else if (op == "grcf") {
|
} else if (op == "grcf") {
|
||||||
send_request(td_api::make_object<td_api::getRecommendedChatFolders>());
|
send_request(td_api::make_object<td_api::getRecommendedChatFolders>());
|
||||||
} else if (op == "gcfdin") {
|
} else if (op == "gcfdin") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user