mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-23 02:00:20 +07:00
Fixed: push notifications on VPN connect/disconnect
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user