From 29d745c87e8375be24c6b0c9ffbc87ae1c4945cf Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 29 Mar 2019 17:04:42 +0300 Subject: [PATCH] Push notifications handling fixes. GitOrigin-RevId: da34e59128b23a7cedcfc8c7a7f64a4c9b5066fe --- td/telegram/MessagesManager.cpp | 2 +- td/telegram/NotificationManager.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 8c95b3187..b68dbe49a 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -18247,7 +18247,7 @@ Result 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"); } diff --git a/td/telegram/NotificationManager.cpp b/td/telegram/NotificationManager.cpp index c7d54dfa8..179fc2268 100644 --- a/td/telegram/NotificationManager.cpp +++ b/td/telegram/NotificationManager.cpp @@ -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"));