Fix parsing of PINNED_ pushes.

GitOrigin-RevId: 52a3f88c905ea744bf305d758799b6d4c29163ee
This commit is contained in:
levlam 2019-03-31 21:33:47 +03:00
parent cb8f8c51e2
commit 2f8aa42776
1 changed files with 7 additions and 1 deletions

View File

@ -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) {