From 8a5d186e3431a15c2bf47f2694cd5464b78c0275 Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 26 Mar 2019 03:29:09 +0300 Subject: [PATCH] Remove processDcUpdate in favor of processPushNotification. GitOrigin-RevId: 7cc785061bd6915cdbf16be4f000992b9e720de0 --- td/generate/scheme/td_api.tl | 3 --- td/generate/scheme/td_api.tlo | Bin 146556 -> 146440 bytes td/telegram/Td.cpp | 14 -------------- td/telegram/Td.h | 2 -- td/telegram/cli.cpp | 5 ----- 5 files changed, 24 deletions(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 080a45c3a..96c01aad3 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -3444,9 +3444,6 @@ deleteLanguagePack language_pack_id:string = Ok; //@description Registers the currently used device for receiving push notifications. Returns a globally unique identifier of the push notification subscription @device_token Device token @other_user_ids List of at most 100 user identifiers of other users currently using the client registerDevice device_token:DeviceToken other_user_ids:vector = PushReceiverId; -//@description Handles a DC_UPDATE push notification. Can be called before authorization @dc Value of the "dc" parameter of the push notification @addr Value of the "addr" parameter of the push notification -processDcUpdate dc:string addr:string = Ok; - //@description Handles a push notification. Can be called before authorization @payload JSON-encoded push notification payload processPushNotification payload:string = Ok; diff --git a/td/generate/scheme/td_api.tlo b/td/generate/scheme/td_api.tlo index f76fa13d4ef897348eb2315251c68a2ed4774898..36b44511f69eb03b2a03ec9f268d3bbc6fb4f0a2 100644 GIT binary patch delta 25 hcmezKgQMdIN5dAzlv#|P+f!#TI>&97`N^2z3;>(?3d#Tg delta 79 zcmV-V0I>gv_z3*?2!ON!WSRj=w`H0ELtZCK2~v~~aB^>BWpi^xV^wfuVRU6_zU|c6 l#u7{d0000R=HDp-WMh*baT)|+WMp!e!JGjvx2X65U_%C`ABX?| diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index e88f19e82..4058f2b69 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -3187,7 +3187,6 @@ bool Td::is_preauthentication_request(int32 id) { case td_api::editCustomLanguagePackInfo::ID: case td_api::setCustomLanguagePackString::ID: case td_api::deleteLanguagePack::ID: - case td_api::processDcUpdate::ID: case td_api::processPushNotification::ID: case td_api::getOption::ID: case td_api::setOption::ID: @@ -4032,7 +4031,6 @@ Status Td::init(DbKey key) { complete_pending_preauthentication_requests([](int32 id) { switch (id) { - case td_api::processDcUpdate::ID: case td_api::processPushNotification::ID: case td_api::setNetworkType::ID: case td_api::getNetworkStatistics::ID: @@ -4748,18 +4746,6 @@ void Td::on_request(uint64 id, td_api::createTemporaryPassword &request) { request.valid_for_, std::move(promise)); } -void Td::on_request(uint64 id, td_api::processDcUpdate &request) { - CLEAN_INPUT_STRING(request.dc_); - CLEAN_INPUT_STRING(request.addr_); - CREATE_OK_REQUEST_PROMISE(); - auto dc_id_raw = to_integer(request.dc_); - if (!DcId::is_valid(dc_id_raw)) { - return promise.set_error(Status::Error("Invalid dc id")); - } - send_closure(G()->connection_creator(), &ConnectionCreator::on_dc_update, DcId::internal(dc_id_raw), request.addr_, - std::move(promise)); -} - void Td::on_request(uint64 id, td_api::processPushNotification &request) { CLEAN_INPUT_STRING(request.payload_); CREATE_OK_REQUEST_PROMISE(); diff --git a/td/telegram/Td.h b/td/telegram/Td.h index 30e35c9c7..04da9d297 100644 --- a/td/telegram/Td.h +++ b/td/telegram/Td.h @@ -397,8 +397,6 @@ class Td final : public NetQueryCallback { void on_request(uint64 id, td_api::createTemporaryPassword &request); - void on_request(uint64 id, td_api::processDcUpdate &request); - void on_request(uint64 id, td_api::processPushNotification &request); void on_request(uint64 id, td_api::registerDevice &request); diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index 5312631dc..5b16b016a 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -1420,11 +1420,6 @@ class CliClient final : public Actor { } else if (op == "dpe") { string passport_element_type = args; send_request(td_api::make_object(as_passport_element_type(passport_element_type))); - } else if (op == "pdu" || op == "processDcUpdate") { - string dc_id; - string ip_port; - std::tie(dc_id, ip_port) = split(args); - send_request(td_api::make_object(dc_id, ip_port)); } else if (op == "ppn") { send_request(td_api::make_object(args)); } else if (op == "gpri") {