diff --git a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp index b41d0e4a9..47b92fb72 100644 --- a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp @@ -423,7 +423,8 @@ void Manager::Private::init(XdgNotifications::NotificationsProxy proxy) { Core::Sandbox::Instance().customEnterFromEventLoop([&] { for (const auto &[key, notifications] : _notifications) { for (const auto &[msgId, notification] : notifications) { - if (id == v::get(notification->id)) { + const auto &nid = notification->id; + if (v::is(nid) && v::get(nid) == id) { if (actionName == "default") { _manager->notificationActivated({ key, msgId }); } else if (actionName == "mail-mark-read") { @@ -447,7 +448,8 @@ void Manager::Private::init(XdgNotifications::NotificationsProxy proxy) { Core::Sandbox::Instance().customEnterFromEventLoop([&] { for (const auto &[key, notifications] : _notifications) { for (const auto &[msgId, notification] : notifications) { - if (id == v::get(notification->id)) { + const auto &nid = notification->id; + if (v::is(nid) && v::get(nid) == id) { _manager->notificationReplied( { key, msgId }, { QString::fromStdString(text), {} }); @@ -468,7 +470,8 @@ void Manager::Private::init(XdgNotifications::NotificationsProxy proxy) { std::string token) { for (const auto &[key, notifications] : _notifications) { for (const auto &[msgId, notification] : notifications) { - if (id == v::get(notification->id)) { + const auto &nid = notification->id; + if (v::is(nid) && v::get(nid) == id) { GLib::setenv("XDG_ACTIVATION_TOKEN", token, true); return; } @@ -501,7 +504,8 @@ void Manager::Private::init(XdgNotifications::NotificationsProxy proxy) { * In all other cases we keep the notification reference so that we may clear the notification later from history, * if the message for that notification is read (e.g. chat is opened or read from another device). */ - if (id == v::get(notification->id) && reason == 2) { + const auto &nid = notification->id; + if (v::is(nid) && v::get(nid) == id && reason == 2) { clearNotification({ key, msgId }); return; }