From 79cb4668f1a651752394b1506e645ab1b8b8391d Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Thu, 24 Apr 2025 06:54:46 +0000 Subject: [PATCH] Fix a crash on Linux without actions notification capability --- .../platform/linux/notifications_manager_linux.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp index 45cb6a3875..d49fecb814 100644 --- a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp @@ -625,10 +625,10 @@ void Manager::Private::showNotification( actions.push_back( tr::lng_notification_reply(tr::now).toStdString()); } - - actions.push_back({}); } + actions.push_back({}); + if (HasCapability("action-icons")) { hints.insert_value( "action-icons", @@ -788,11 +788,9 @@ void Manager::Private::showNotification( info.subtitle), lt_message, info.message).toStdString()).c_str(), - !actions.empty() - ? (actions - | ranges::views::transform(&gi::cstring::c_str) - | ranges::to_vector).data() - : nullptr, + (actions + | ranges::views::transform(&gi::cstring::c_str) + | ranges::to_vector).data(), hints.end().gobj_(), -1, nullptr,