mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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([&] {
|
Core::Sandbox::Instance().customEnterFromEventLoop([&] {
|
||||||
for (const auto &[key, notifications] : _notifications) {
|
for (const auto &[key, notifications] : _notifications) {
|
||||||
for (const auto &[msgId, notification] : 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") {
|
if (actionName == "default") {
|
||||||
_manager->notificationActivated({ key, msgId });
|
_manager->notificationActivated({ key, msgId });
|
||||||
} else if (actionName == "mail-mark-read") {
|
} else if (actionName == "mail-mark-read") {
|
||||||
|
@ -447,7 +448,8 @@ void Manager::Private::init(XdgNotifications::NotificationsProxy proxy) {
|
||||||
Core::Sandbox::Instance().customEnterFromEventLoop([&] {
|
Core::Sandbox::Instance().customEnterFromEventLoop([&] {
|
||||||
for (const auto &[key, notifications] : _notifications) {
|
for (const auto &[key, notifications] : _notifications) {
|
||||||
for (const auto &[msgId, notification] : 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(
|
_manager->notificationReplied(
|
||||||
{ key, msgId },
|
{ key, msgId },
|
||||||
{ QString::fromStdString(text), {} });
|
{ QString::fromStdString(text), {} });
|
||||||
|
@ -468,7 +470,8 @@ void Manager::Private::init(XdgNotifications::NotificationsProxy proxy) {
|
||||||
std::string token) {
|
std::string token) {
|
||||||
for (const auto &[key, notifications] : _notifications) {
|
for (const auto &[key, notifications] : _notifications) {
|
||||||
for (const auto &[msgId, notification] : 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);
|
GLib::setenv("XDG_ACTIVATION_TOKEN", token, true);
|
||||||
return;
|
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,
|
* 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 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 });
|
clearNotification({ key, msgId });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue