summary refs log tree commit diff
path: root/src/notifications/ManagerMac.mm
diff options
context:
space:
mode:
authorMax Sandholm <max@sandholm.org>2018-07-11 17:33:02 +0300
committermujx <mujx@users.noreply.github.com>2018-07-11 17:33:02 +0300
commit80ebe3f29debb7f2020757252d1e2b4ae8a45869 (patch)
tree07a9bb42e559503787fbde1fd4eec7922bbafed0 /src/notifications/ManagerMac.mm
parentUse QSharedPointer::data to be compatible with Qt < 5.11 (diff)
downloadnheko-80ebe3f29debb7f2020757252d1e2b4ae8a45869.tar.xz
Working D-Bus desktop notifications (#361)
* Working D-Bus desktop notifications

* Remove return type on constructor

* Fix the Windows placeholder class

* Fix wrong variable name

* Fix windows and macOS versions of notificationsmanager
Diffstat (limited to 'src/notifications/ManagerMac.mm')
-rw-r--r--src/notifications/ManagerMac.mm32
1 files changed, 29 insertions, 3 deletions
diff --git a/src/notifications/ManagerMac.mm b/src/notifications/ManagerMac.mm

index 48fb46ca..66ef713f 100644 --- a/src/notifications/ManagerMac.mm +++ b/src/notifications/ManagerMac.mm
@@ -7,16 +7,42 @@ - (void)set_identityImage:(NSImage *)image; @end +NotificationsManager::NotificationsManager(QObject *parent): QObject(parent) +{ + +} + void -NotificationsManager::postNotification(const QString &roomName, const QString &userName, const QString &message) +NotificationsManager::postNotification( + const QString &roomId, + const QString &eventId, + const QString &roomName, + const QString &senderName, + const QString &text, + const QImage &icon) { + Q_UNUSED(roomId); + Q_UNUSED(eventId); + Q_UNUSED(icon); + NSUserNotification * notif = [[NSUserNotification alloc] init]; notif.title = roomName.toNSString(); - notif.subtitle = QString("%1 sent a message").arg(userName).toNSString(); - notif.informativeText = message.toNSString(); + notif.subtitle = QString("%1 sent a message").arg(senderName).toNSString(); + notif.informativeText = text.toNSString(); notif.soundName = NSUserNotificationDefaultSoundName; [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification: notif]; [notif autorelease]; } + +//unused +void +NotificationsManager::actionInvoked(uint, QString) +{ +} + +void +NotificationsManager::notificationClosed(uint, uint) +{ +}