Fixed: push notifications on VPN connect/disconnect

This commit is contained in:
dranik
2026-05-04 23:38:27 +03:00
parent 009ca981d5
commit 6087375fb0
17 changed files with 238 additions and 17 deletions
+6 -3
View File
@@ -5,16 +5,19 @@
#include <QDebug>
#include "notificationHandler.h"
#if defined(Q_OS_IOS)
#if defined(Q_OS_ANDROID)
# include "platforms/android/android_notificationhandler.h"
#elif defined(Q_OS_IOS)
# include "platforms/ios/iosnotificationhandler.h"
#else
# include "systemTrayNotificationHandler.h"
#endif
// static
NotificationHandler* NotificationHandler::create(QObject* parent) {
#if defined(Q_OS_IOS)
#if defined(Q_OS_ANDROID)
return new AndroidNotificationHandler(parent);
#elif defined(Q_OS_IOS)
return new IOSNotificationHandler(parent);
#else
return new SystemTrayNotificationHandler(parent);
@@ -10,6 +10,10 @@
# include "platforms/macos/macosutils.h"
#endif
#ifdef MACOS_NE
# include "platforms/macos/macos_ne_vpn_notification.h"
#endif
#include <QApplication>
#include <QDesktopServices>
#include <QIcon>
@@ -152,6 +156,12 @@ void SystemTrayNotificationHandler::notify(NotificationHandler::Message type,
int timerMsec) {
Q_UNUSED(type);
#ifdef MACOS_NE
Q_UNUSED(timerMsec);
macosNePostVpnStateNotification(title, message);
return;
#endif
QIcon icon(ConnectedTrayIconName);
m_systemTrayIcon.showMessage(title, message, icon, timerMsec);
}