Push notifications handling fixes.

GitOrigin-RevId: da34e59128b23a7cedcfc8c7a7f64a4c9b5066fe
This commit is contained in:
levlam 2019-03-29 17:04:42 +03:00
parent aa9781bd71
commit 29d745c87e
2 changed files with 3 additions and 1 deletions

View File

@ -18247,7 +18247,7 @@ Result<MessagesManager::MessagePushNotificationInfo> MessagesManager::get_messag
bool have_settings;
int32 mute_until;
std::tie(have_settings, mute_until) = get_dialog_mute_until(settings_dialog_id, settings_dialog);
if (have_settings && mute_until <= date) {
if (have_settings && mute_until > date) {
return Status::Error("Ignore notification in muted chat");
}

View File

@ -2702,6 +2702,8 @@ Status NotificationManager::process_push_notification_payload(string payload) {
if (!sender_user_id.is_valid()) {
return Status::Error("Receive invalid chat_from_id");
}
} else if (dialog_id.get_type() == DialogType::User) {
sender_user_id = dialog_id.get_user_id();
}
TRY_RESULT(contains_mention_int, get_json_object_int_field(custom, "mention"));