Remove getChatStatisticsUrl method.
This commit is contained in:
parent
cdb06da112
commit
2ce0be4fe7
@ -5428,9 +5428,6 @@ reportChat chat_id:int53 message_ids:vector<int53> reason:ChatReportReason text:
|
||||
//@chat_id Chat identifier @file_id Identifier of the photo to report. Only full photos from chatPhoto can be reported @reason The reason for reporting the chat photo @text Additional report details; 0-1024 characters
|
||||
reportChatPhoto chat_id:int53 file_id:int32 reason:ChatReportReason text:string = Ok;
|
||||
|
||||
//@description Returns an HTTP URL with the chat statistics. Currently this method of getting the statistics are disabled and can be deleted in the future @chat_id Chat identifier @parameters Parameters for the request @is_dark Pass true if a URL with the dark theme must be returned
|
||||
getChatStatisticsUrl chat_id:int53 parameters:string is_dark:Bool = HttpUrl;
|
||||
|
||||
//@description Returns detailed statistics about a chat. Currently this method can be used only for supergroups and channels. Can be used only if supergroupFullInfo.can_get_statistics == true @chat_id Chat identifier @is_dark Pass true if a dark theme is used by the application
|
||||
getChatStatistics chat_id:int53 is_dark:Bool = ChatStatistics;
|
||||
|
||||
|
@ -1498,7 +1498,6 @@ messages.updatePinnedMessage#d2aaf7ec flags:# silent:flags.0?true unpin:flags.1?
|
||||
messages.sendVote#10ea6184 peer:InputPeer msg_id:int options:Vector<bytes> = Updates;
|
||||
messages.getPollResults#73bb643b peer:InputPeer msg_id:int = Updates;
|
||||
messages.getOnlines#6e2be050 peer:InputPeer = ChatOnlines;
|
||||
messages.getStatsURL#812c2ae6 flags:# dark:flags.0?true peer:InputPeer params:string = StatsURL;
|
||||
messages.editChatAbout#def60797 peer:InputPeer about:string = Bool;
|
||||
messages.editChatDefaultBannedRights#a5866b41 peer:InputPeer banned_rights:ChatBannedRights = Updates;
|
||||
messages.getEmojiKeywords#35a0e062 lang_code:string = EmojiKeywordsDifference;
|
||||
|
@ -4484,42 +4484,6 @@ class EditPeerFoldersQuery final : public Td::ResultHandler {
|
||||
}
|
||||
};
|
||||
|
||||
class GetStatsUrlQuery final : public Td::ResultHandler {
|
||||
Promise<td_api::object_ptr<td_api::httpUrl>> promise_;
|
||||
DialogId dialog_id_;
|
||||
|
||||
public:
|
||||
explicit GetStatsUrlQuery(Promise<td_api::object_ptr<td_api::httpUrl>> &&promise) : promise_(std::move(promise)) {
|
||||
}
|
||||
|
||||
void send(DialogId dialog_id, const string ¶meters, bool is_dark) {
|
||||
dialog_id_ = dialog_id;
|
||||
auto input_peer = td->messages_manager_->get_input_peer(dialog_id, AccessRights::Read);
|
||||
CHECK(input_peer != nullptr);
|
||||
int32 flags = 0;
|
||||
if (is_dark) {
|
||||
flags |= telegram_api::messages_getStatsURL::DARK_MASK;
|
||||
}
|
||||
send_query(G()->net_query_creator().create(
|
||||
telegram_api::messages_getStatsURL(flags, false /*ignored*/, std::move(input_peer), parameters)));
|
||||
}
|
||||
|
||||
void on_result(uint64 id, BufferSlice packet) final {
|
||||
auto result_ptr = fetch_result<telegram_api::messages_getStatsURL>(packet);
|
||||
if (result_ptr.is_error()) {
|
||||
return on_error(id, result_ptr.move_as_error());
|
||||
}
|
||||
|
||||
auto result = result_ptr.move_as_ok();
|
||||
promise_.set_value(td_api::make_object<td_api::httpUrl>(result->url_));
|
||||
}
|
||||
|
||||
void on_error(uint64 id, Status status) final {
|
||||
td->messages_manager_->on_get_dialog_error(dialog_id_, status, "GetStatsUrlQuery");
|
||||
promise_.set_error(std::move(status));
|
||||
}
|
||||
};
|
||||
|
||||
class GetChannelDifferenceQuery final : public Td::ResultHandler {
|
||||
DialogId dialog_id_;
|
||||
int32 pts_;
|
||||
@ -8465,23 +8429,6 @@ void MessagesManager::fix_dialog_action_bar(Dialog *d) {
|
||||
}
|
||||
}
|
||||
|
||||
void MessagesManager::get_dialog_statistics_url(DialogId dialog_id, const string ¶meters, bool is_dark,
|
||||
Promise<td_api::object_ptr<td_api::httpUrl>> &&promise) {
|
||||
Dialog *d = get_dialog_force(dialog_id, "get_dialog_statistics_url");
|
||||
if (d == nullptr) {
|
||||
return promise.set_error(Status::Error(400, "Chat not found"));
|
||||
}
|
||||
|
||||
if (!have_input_peer(dialog_id, AccessRights::Read)) {
|
||||
return promise.set_error(Status::Error(400, "Can't access the chat"));
|
||||
}
|
||||
if (dialog_id.get_type() == DialogType::SecretChat) {
|
||||
return promise.set_error(Status::Error(500, "There are no statistics for secret chats"));
|
||||
}
|
||||
|
||||
td_->create_handler<GetStatsUrlQuery>(std::move(promise))->send(dialog_id, parameters, is_dark);
|
||||
}
|
||||
|
||||
Result<string> MessagesManager::get_login_button_url(FullMessageId full_message_id, int64 button_id) {
|
||||
Dialog *d = get_dialog_force(full_message_id.get_dialog_id(), "get_login_button_url");
|
||||
if (d == nullptr) {
|
||||
|
@ -799,9 +799,6 @@ class MessagesManager final : public Actor {
|
||||
void on_get_peer_settings(DialogId dialog_id, tl_object_ptr<telegram_api::peerSettings> &&peer_settings,
|
||||
bool ignore_privacy_exception = false);
|
||||
|
||||
void get_dialog_statistics_url(DialogId dialog_id, const string ¶meters, bool is_dark,
|
||||
Promise<td_api::object_ptr<td_api::httpUrl>> &&promise);
|
||||
|
||||
void on_authorization_success();
|
||||
|
||||
void before_get_difference();
|
||||
|
@ -7090,14 +7090,6 @@ void Td::on_request(uint64 id, td_api::reportChatPhoto &request) {
|
||||
r_report_reason.move_as_ok(), std::move(promise));
|
||||
}
|
||||
|
||||
void Td::on_request(uint64 id, td_api::getChatStatisticsUrl &request) {
|
||||
CHECK_IS_USER();
|
||||
CLEAN_INPUT_STRING(request.parameters_);
|
||||
CREATE_REQUEST_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, const td_api::getChatStatistics &request) {
|
||||
CHECK_IS_USER();
|
||||
CREATE_REQUEST_PROMISE();
|
||||
|
@ -1060,8 +1060,6 @@ class Td final : public Actor {
|
||||
|
||||
void on_request(uint64 id, td_api::reportChatPhoto &request);
|
||||
|
||||
void on_request(uint64 id, td_api::getChatStatisticsUrl &request);
|
||||
|
||||
void on_request(uint64 id, const td_api::getChatStatistics &request);
|
||||
|
||||
void on_request(uint64 id, const td_api::getMessageStatistics &request);
|
||||
|
@ -4184,12 +4184,6 @@ class CliClient final : public Actor {
|
||||
get_args(args, chat_id, file_id, reason, text);
|
||||
send_request(td_api::make_object<td_api::reportChatPhoto>(as_chat_id(chat_id), as_file_id(file_id),
|
||||
get_chat_report_reason(reason), text));
|
||||
} else if (op == "gcsu") {
|
||||
string chat_id;
|
||||
string parameters;
|
||||
bool is_dark;
|
||||
get_args(args, chat_id, parameters, is_dark);
|
||||
send_request(td_api::make_object<td_api::getChatStatisticsUrl>(as_chat_id(chat_id), parameters, is_dark));
|
||||
} else if (op == "gcst") {
|
||||
string chat_id;
|
||||
bool is_dark;
|
||||
|
Loading…
Reference in New Issue
Block a user