mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Try fixing crashes on Linux.
This commit is contained in:
parent
f024ceecdd
commit
11d0f9db03
1 changed files with 8 additions and 4 deletions
|
@ -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<uint>(notification->id)) {
|
||||
const auto &nid = notification->id;
|
||||
if (v::is<uint>(nid) && v::get<uint>(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<uint>(notification->id)) {
|
||||
const auto &nid = notification->id;
|
||||
if (v::is<uint>(nid) && v::get<uint>(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<uint>(notification->id)) {
|
||||
const auto &nid = notification->id;
|
||||
if (v::is<uint>(nid) && v::get<uint>(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<uint>(notification->id) && reason == 2) {
|
||||
const auto &nid = notification->id;
|
||||
if (v::is<uint>(nid) && v::get<uint>(nid) == id && reason == 2) {
|
||||
clearNotification({ key, msgId });
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue