From 2f8aa427763eba8a478568be1feca0550a65feb3 Mon Sep 17 00:00:00 2001 From: levlam Date: Sun, 31 Mar 2019 21:33:47 +0300 Subject: [PATCH] Fix parsing of PINNED_ pushes. GitOrigin-RevId: 52a3f88c905ea744bf305d758799b6d4c29163ee --- td/telegram/NotificationManager.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/td/telegram/NotificationManager.cpp b/td/telegram/NotificationManager.cpp index c4f571e0..cee9b743 100644 --- a/td/telegram/NotificationManager.cpp +++ b/td/telegram/NotificationManager.cpp @@ -2962,8 +2962,14 @@ Status NotificationManager::process_push_notification_payload(string payload) { } if (dialog_id.get_type() == DialogType::User) { sender_name = std::move(loc_args[0]); + } else if (sender_user_id.is_valid() && begins_with(loc_key, "PINNED_")) { + if (loc_args.size() < 2) { + return Status::Error("Expected chat title as the last argument"); + } + loc_args.pop_back(); } - // chat title for CHAT_*, CHANNEL_*, ENCRYPTED_MESSAGE and PINNED_*, sender name for MESSAGE_* and CONTACT_JOINED + // chat title for CHAT_*, CHANNEL_* and ENCRYPTED_MESSAGE, sender name for MESSAGE_* and CONTACT_JOINED + // chat title or sender name for PINNED_* loc_args.erase(loc_args.begin()); if (loc_args.size() > 1) {