Skip to content

Commit

Permalink
Support QUIZ push notifications.
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 34e2e7c364b2670861900ce8371534d0ab368afb
  • Loading branch information
levlam committed Jan 21, 2020
1 parent b272cf0 commit e6b209f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
4 changes: 2 additions & 2 deletions td/generate/scheme/td_api.tl
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
pushMessageContentPoll question:string is_pinned:Bool = PushMessageContent;
//@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_regular:Bool is_pinned:Bool = PushMessageContent;

//@description A screenshot of a message in the chat has been taken
pushMessageContentScreenshotTaken = PushMessageContent;
Expand Down
Binary file modified td/generate/scheme/td_api.tlo
Binary file not shown.
8 changes: 8 additions & 0 deletions td/telegram/NotificationManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2833,6 +2833,11 @@ string NotificationManager::convert_loc_key(const string &loc_key) {
return "MESSAGE_POLL";
}
break;
case 'Q':
if (loc_key == "MESSAGE_QUIZ") {
return "MESSAGE_QUIZ";
}
break;
case 'R':
if (loc_key == "MESSAGE_ROUND") {
return "MESSAGE_VIDEO_NOTE";
Expand Down Expand Up @@ -2864,6 +2869,9 @@ string NotificationManager::convert_loc_key(const string &loc_key) {
if (loc_key == "PINNED_AUDIO") {
return "PINNED_MESSAGE_VOICE_NOTE";
}
if (loc_key == "PINNED_QUIZ") {
return "PINNED_MESSAGE_QUIZ";
}
if (loc_key == "CHAT_RETURNED") {
return "MESSAGE_CHAT_ADD_MEMBERS_RETURNED";
}
Expand Down
7 changes: 6 additions & 1 deletion td/telegram/NotificationType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,12 @@ class NotificationTypePushMessage : public NotificationType {
return td_api::make_object<td_api::pushMessageContentMediaAlbum>(to_integer<int32>(arg), true, false);
}
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;
case 'S':
Expand Down

0 comments on commit e6b209f

Please sign in to comment.