Support QUIZ push notifications.

GitOrigin-RevId: 34e2e7c364b2670861900ce8371534d0ab368afb
This commit is contained in:
levlam 2020-01-21 04:29:35 +03:00
parent b272cf02ba
commit e6b209fb72
4 changed files with 16 additions and 3 deletions

View File

@ -2230,8 +2230,8 @@ pushMessageContentLocation is_live:Bool is_pinned:Bool = PushMessageContent;
//@description A photo message @photo Message content; may be null @caption Photo caption @is_secret True, if the photo is secret @is_pinned True, if the message is a pinned message with the specified content //@description A photo message @photo Message content; may be null @caption Photo caption @is_secret True, if the photo is secret @is_pinned True, if the message is a pinned message with the specified content
pushMessageContentPhoto photo:photo caption:string is_secret:Bool is_pinned:Bool = PushMessageContent; pushMessageContentPhoto photo:photo caption:string is_secret:Bool is_pinned:Bool = PushMessageContent;
//@description A message with a poll @question Poll question @is_pinned True, if the message is a pinned message with the specified content //@description A message with a poll @question Poll question @is_regular True, if the poll is regular and not in quiz mode @is_pinned True, if the message is a pinned message with the specified content
pushMessageContentPoll question:string is_pinned:Bool = PushMessageContent; pushMessageContentPoll question:string is_regular:Bool is_pinned:Bool = PushMessageContent;
//@description A screenshot of a message in the chat has been taken //@description A screenshot of a message in the chat has been taken
pushMessageContentScreenshotTaken = PushMessageContent; pushMessageContentScreenshotTaken = PushMessageContent;

Binary file not shown.

View File

@ -2833,6 +2833,11 @@ string NotificationManager::convert_loc_key(const string &loc_key) {
return "MESSAGE_POLL"; return "MESSAGE_POLL";
} }
break; break;
case 'Q':
if (loc_key == "MESSAGE_QUIZ") {
return "MESSAGE_QUIZ";
}
break;
case 'R': case 'R':
if (loc_key == "MESSAGE_ROUND") { if (loc_key == "MESSAGE_ROUND") {
return "MESSAGE_VIDEO_NOTE"; return "MESSAGE_VIDEO_NOTE";
@ -2864,6 +2869,9 @@ string NotificationManager::convert_loc_key(const string &loc_key) {
if (loc_key == "PINNED_AUDIO") { if (loc_key == "PINNED_AUDIO") {
return "PINNED_MESSAGE_VOICE_NOTE"; return "PINNED_MESSAGE_VOICE_NOTE";
} }
if (loc_key == "PINNED_QUIZ") {
return "PINNED_MESSAGE_QUIZ";
}
if (loc_key == "CHAT_RETURNED") { if (loc_key == "CHAT_RETURNED") {
return "MESSAGE_CHAT_ADD_MEMBERS_RETURNED"; return "MESSAGE_CHAT_ADD_MEMBERS_RETURNED";
} }

View File

@ -262,7 +262,12 @@ class NotificationTypePushMessage : public NotificationType {
return td_api::make_object<td_api::pushMessageContentMediaAlbum>(to_integer<int32>(arg), true, false); return td_api::make_object<td_api::pushMessageContentMediaAlbum>(to_integer<int32>(arg), true, false);
} }
if (key == "MESSAGE_POLL") { if (key == "MESSAGE_POLL") {
return td_api::make_object<td_api::pushMessageContentPoll>(arg, is_pinned); return td_api::make_object<td_api::pushMessageContentPoll>(arg, true, is_pinned);
}
break;
case 'Q':
if (key == "MESSAGE_QUIZ") {
return td_api::make_object<td_api::pushMessageContentPoll>(arg, false, is_pinned);
} }
break; break;
case 'S': case 'S':