Add dummy processPushNotification.
GitOrigin-RevId: 71136025e1a4ddce5ace64a34fef766d1b29f7d5
This commit is contained in:
parent
ba978b64e7
commit
59672cad10
@ -2511,6 +2511,9 @@ getTemporaryPasswordState = TemporaryPasswordState;
|
||||
//@description Handles a DC_UPDATE push service notification. Can be called before authorization @dc Value of the "dc" parameter of the notification @addr Value of the "addr" parameter of the notification
|
||||
processDcUpdate dc:string addr:string = Ok;
|
||||
|
||||
//@description Handles a push notification. Can be called before authorization @payload Push notification payload
|
||||
processPushNotification payload:string = Ok;
|
||||
|
||||
|
||||
//@description Returns the current user
|
||||
getMe = User;
|
||||
|
Binary file not shown.
@ -1842,6 +1842,11 @@ void NotificationManager::on_notification_default_delay_changed() {
|
||||
VLOG(notifications) << "Set notification_default_delay_ms to " << notification_default_delay_ms_;
|
||||
}
|
||||
|
||||
void NotificationManager::process_push_notification(const string &payload, Promise<Unit> &&promise) {
|
||||
VLOG(notifications) << "Process push notification \"" << payload << '"';
|
||||
promise.set_value(Unit());
|
||||
}
|
||||
|
||||
void NotificationManager::before_get_difference() {
|
||||
if (is_disabled()) {
|
||||
return;
|
||||
|
@ -85,6 +85,8 @@ class NotificationManager : public Actor {
|
||||
|
||||
void on_notification_default_delay_changed();
|
||||
|
||||
void process_push_notification(const string &payload, Promise<Unit> &&promise);
|
||||
|
||||
void before_get_difference();
|
||||
|
||||
void after_get_difference();
|
||||
|
@ -3220,6 +3220,7 @@ bool Td::is_preinitialization_request(int32 id) {
|
||||
bool Td::is_preauthentication_request(int32 id) {
|
||||
switch (id) {
|
||||
case td_api::processDcUpdate::ID:
|
||||
case td_api::processPushNotification::ID:
|
||||
case td_api::getLocalizationTargetInfo::ID:
|
||||
case td_api::getLanguagePackStrings::ID:
|
||||
case td_api::setCustomLanguagePack::ID:
|
||||
@ -4015,6 +4016,7 @@ 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:
|
||||
case td_api::addNetworkStatistics::ID:
|
||||
@ -4691,6 +4693,13 @@ void Td::on_request(uint64 id, td_api::processDcUpdate &request) {
|
||||
std::move(promise));
|
||||
}
|
||||
|
||||
void Td::on_request(uint64 id, td_api::processPushNotification &request) {
|
||||
CLEAN_INPUT_STRING(request.payload_);
|
||||
CREATE_OK_REQUEST_PROMISE();
|
||||
send_closure(G()->notification_manager(), &NotificationManager::process_push_notification,
|
||||
std::move(request.payload_), std::move(promise));
|
||||
}
|
||||
|
||||
void Td::on_request(uint64 id, td_api::registerDevice &request) {
|
||||
CHECK_IS_USER();
|
||||
if (request.device_token_ == nullptr) {
|
||||
|
@ -380,6 +380,8 @@ class Td final : public NetQueryCallback {
|
||||
|
||||
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);
|
||||
|
||||
void on_request(uint64 id, td_api::getUserPrivacySettingRules &request);
|
||||
|
@ -1359,6 +1359,8 @@ class CliClient final : public Actor {
|
||||
string ip_port;
|
||||
std::tie(dc_id, ip_port) = split(args);
|
||||
send_request(make_tl_object<td_api::processDcUpdate>(dc_id, ip_port));
|
||||
} else if (op == "ppn") {
|
||||
send_request(make_tl_object<td_api::processPushNotification>(args));
|
||||
} else if (op == "rda") {
|
||||
send_request(make_tl_object<td_api::registerDevice>(make_tl_object<td_api::deviceTokenApplePush>(args, true),
|
||||
as_user_ids("")));
|
||||
|
@ -145,7 +145,7 @@ inline StringBuilder &operator<<(StringBuilder &builder, const Escaped &escaped)
|
||||
builder << static_cast<char>(c);
|
||||
} else {
|
||||
const char *oct = "01234567";
|
||||
builder << "\\0" << oct[c >> 6] << oct[(c >> 3) & 7] << oct[c & 7];
|
||||
builder << '\\' << oct[c >> 6] << oct[(c >> 3) & 7] << oct[c & 7];
|
||||
}
|
||||
}
|
||||
return builder;
|
||||
|
Reference in New Issue
Block a user