From 76b4de24137cf6da38183f3b57f4bab469083cab Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 3 Apr 2019 02:08:39 +0300 Subject: [PATCH] Silent push notifications support. GitOrigin-RevId: 7e71c83c2a1a2d29b4f1279b020ee71f20aa63c4 --- td/telegram/NotificationManager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/td/telegram/NotificationManager.cpp b/td/telegram/NotificationManager.cpp index 785b35f71..9696ea659 100644 --- a/td/telegram/NotificationManager.cpp +++ b/td/telegram/NotificationManager.cpp @@ -2845,11 +2845,11 @@ Status NotificationManager::process_push_notification_payload(string payload, Pr if (sent_date - 28 * 86400 <= google_sent_time && google_sent_time <= sent_date + 5) { sent_date = narrow_cast(google_sent_time); } - } else if (field_value.first == "google.notification.sound" && field_value.second.type() != JsonValue::Type::Null) { + } else if (field_value.first == "silent" && field_value.second.type() != JsonValue::Type::Null) { if (field_value.second.type() != JsonValue::Type::String) { - return Status::Error("Expected notification sound as a String"); + return Status::Error("Expected silent flag as a String"); } - is_silent = field_value.second.get_string().empty(); + is_silent = !field_value.second.get_string().empty(); } } if (!clean_input_string(loc_key)) {