From b962309498c243549c2b2e4c71440c4a7d88ccc1 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Mon, 3 Mar 2025 18:23:37 +0000 Subject: [PATCH] Move hints.lookup_value() out of xdg_notifications_notifications_call_notify Or it gets executed after hints.end() which clears hints --- .../platform/linux/notifications_manager_linux.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp index b8c2f77b3..4cf1f82e2 100644 --- a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp @@ -743,6 +743,9 @@ void Manager::Private::showNotification( StartServiceAsync( _proxy.get_connection(), crl::guard(weak, [=]() mutable { + const auto hasImage = !imageKey.empty() + && hints.lookup_value(imageKey); + const auto hasBodyMarkup = HasCapability("body-markup"); const auto callbackWrap = gi::unwrap( @@ -780,9 +783,9 @@ void Manager::Private::showNotification( _interface.gobj_(), AppName.data(), 0, - (imageKey.empty() || !hints.lookup_value(imageKey) - ? base::IconName().toStdString() - : std::string()).c_str(), + (!hasImage + ? base::IconName().toStdString() + : std::string()).c_str(), (hasBodyMarkup || info.subtitle.isEmpty() ? info.title.toStdString() : info.subtitle.toStdString()