Add is_dark parameter to getChatStatisticsUrl.
GitOrigin-RevId: f2381e8df342efa288fa191df27a79a799f972e2
This commit is contained in:
parent
d71f8e375e
commit
651172ed85
@ -3613,8 +3613,8 @@ changeChatReportSpamState chat_id:int53 is_spam_chat:Bool = Ok;
|
|||||||
reportChat chat_id:int53 reason:ChatReportReason message_ids:vector<int53> = Ok;
|
reportChat chat_id:int53 reason:ChatReportReason message_ids:vector<int53> = Ok;
|
||||||
|
|
||||||
|
|
||||||
//@description Returns URL with chat statistics. Currently this method can be used only for channels @chat_id Chat identifier @parameters Parameters from "tg://statsrefresh?params=******" link
|
//@description Returns URL with the chat statistics. Currently this method can be used only for channels @chat_id Chat identifier @parameters Parameters from "tg://statsrefresh?params=******" link @is_dark Pass true if a URL with the dark theme must be returned
|
||||||
getChatStatisticsUrl chat_id:int53 parameters:string = HttpUrl;
|
getChatStatisticsUrl chat_id:int53 parameters:string is_dark:Bool = HttpUrl;
|
||||||
|
|
||||||
|
|
||||||
//@description Returns storage usage statistics. Can be called before authorization @chat_limit Maximum number of chats with the largest storage usage for which separate statistics should be returned. All other chats will be grouped in entries with chat_id == 0. If the chat info database is not used, the chat_limit is ignored and is always set to 0
|
//@description Returns storage usage statistics. Can be called before authorization @chat_limit Maximum number of chats with the largest storage usage for which separate statistics should be returned. All other chats will be grouped in entries with chat_id == 0. If the chat info database is not used, the chat_limit is ignored and is always set to 0
|
||||||
|
Binary file not shown.
@ -3295,7 +3295,8 @@ class GetStatsUrlQuery : public Td::ResultHandler {
|
|||||||
explicit GetStatsUrlQuery(Promise<td_api::object_ptr<td_api::httpUrl>> &&promise) : promise_(std::move(promise)) {
|
explicit GetStatsUrlQuery(Promise<td_api::object_ptr<td_api::httpUrl>> &&promise) : promise_(std::move(promise)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void send(DialogId dialog_id, const string ¶meters) {
|
void send(DialogId dialog_id, const string ¶meters, bool is_dark) {
|
||||||
|
// TODO use parameters and is_dark
|
||||||
dialog_id_ = dialog_id;
|
dialog_id_ = dialog_id;
|
||||||
auto input_peer = td->messages_manager_->get_input_peer(dialog_id, AccessRights::Read);
|
auto input_peer = td->messages_manager_->get_input_peer(dialog_id, AccessRights::Read);
|
||||||
CHECK(input_peer != nullptr);
|
CHECK(input_peer != nullptr);
|
||||||
@ -6278,7 +6279,7 @@ void MessagesManager::on_get_peer_settings(DialogId dialog_id,
|
|||||||
on_dialog_updated(dialog_id, "can_report_spam");
|
on_dialog_updated(dialog_id, "can_report_spam");
|
||||||
}
|
}
|
||||||
|
|
||||||
void MessagesManager::get_dialog_statistics_url(DialogId dialog_id, const string ¶meters,
|
void MessagesManager::get_dialog_statistics_url(DialogId dialog_id, const string ¶meters, bool is_dark,
|
||||||
Promise<td_api::object_ptr<td_api::httpUrl>> &&promise) {
|
Promise<td_api::object_ptr<td_api::httpUrl>> &&promise) {
|
||||||
Dialog *d = get_dialog_force(dialog_id);
|
Dialog *d = get_dialog_force(dialog_id);
|
||||||
if (d == nullptr) {
|
if (d == nullptr) {
|
||||||
@ -6292,7 +6293,7 @@ void MessagesManager::get_dialog_statistics_url(DialogId dialog_id, const string
|
|||||||
return promise.set_error(Status::Error(500, "There is no statistics for secret chats"));
|
return promise.set_error(Status::Error(500, "There is no statistics for secret chats"));
|
||||||
}
|
}
|
||||||
|
|
||||||
td_->create_handler<GetStatsUrlQuery>(std::move(promise))->send(dialog_id, parameters);
|
td_->create_handler<GetStatsUrlQuery>(std::move(promise))->send(dialog_id, parameters, is_dark);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MessagesManager::load_secret_thumbnail(FileId thumbnail_file_id) {
|
void MessagesManager::load_secret_thumbnail(FileId thumbnail_file_id) {
|
||||||
|
@ -638,7 +638,7 @@ class MessagesManager : public Actor {
|
|||||||
void report_dialog(DialogId dialog_id, const tl_object_ptr<td_api::ChatReportReason> &reason,
|
void report_dialog(DialogId dialog_id, const tl_object_ptr<td_api::ChatReportReason> &reason,
|
||||||
const vector<MessageId> &message_ids, Promise<Unit> &&promise);
|
const vector<MessageId> &message_ids, Promise<Unit> &&promise);
|
||||||
|
|
||||||
void get_dialog_statistics_url(DialogId dialog_id, const string ¶meters,
|
void get_dialog_statistics_url(DialogId dialog_id, const string ¶meters, bool is_dark,
|
||||||
Promise<td_api::object_ptr<td_api::httpUrl>> &&promise);
|
Promise<td_api::object_ptr<td_api::httpUrl>> &&promise);
|
||||||
|
|
||||||
void on_get_peer_settings(DialogId dialog_id, tl_object_ptr<telegram_api::peerSettings> &&peer_settings);
|
void on_get_peer_settings(DialogId dialog_id, tl_object_ptr<telegram_api::peerSettings> &&peer_settings);
|
||||||
|
@ -6293,7 +6293,8 @@ void Td::on_request(uint64 id, td_api::getChatStatisticsUrl &request) {
|
|||||||
CHECK_IS_USER();
|
CHECK_IS_USER();
|
||||||
CREATE_REQUEST_PROMISE();
|
CREATE_REQUEST_PROMISE();
|
||||||
CLEAN_INPUT_STRING(request.parameters_);
|
CLEAN_INPUT_STRING(request.parameters_);
|
||||||
messages_manager_->get_dialog_statistics_url(DialogId(request.chat_id_), request.parameters_, std::move(promise));
|
messages_manager_->get_dialog_statistics_url(DialogId(request.chat_id_), request.parameters_, request.is_dark_,
|
||||||
|
std::move(promise));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Td::on_request(uint64 id, td_api::setChatNotificationSettings &request) {
|
void Td::on_request(uint64 id, td_api::setChatNotificationSettings &request) {
|
||||||
|
@ -3548,9 +3548,11 @@ class CliClient final : public Actor {
|
|||||||
} else if (op == "gcsu") {
|
} else if (op == "gcsu") {
|
||||||
string chat_id;
|
string chat_id;
|
||||||
string parameters;
|
string parameters;
|
||||||
std::tie(chat_id, parameters) = split(args);
|
string is_dark;
|
||||||
|
std::tie(chat_id, args) = split(args);
|
||||||
|
std::tie(parameters, is_dark) = split(args);
|
||||||
|
|
||||||
send_request(td_api::make_object<td_api::getChatStatisticsUrl>(as_chat_id(args), parameters));
|
send_request(td_api::make_object<td_api::getChatStatisticsUrl>(as_chat_id(args), parameters, as_bool(is_dark)));
|
||||||
} else if (op == "rsgs" || op == "rchs") {
|
} else if (op == "rsgs" || op == "rchs") {
|
||||||
string supergroup_id;
|
string supergroup_id;
|
||||||
string user_id;
|
string user_id;
|
||||||
|
Loading…
Reference in New Issue
Block a user