forked from mirror/nheko
parent
ed9501023a
commit
506cf68072
@ -0,0 +1,12 @@ |
||||
#pragma once |
||||
|
||||
#include <QImage> |
||||
#include <QString> |
||||
|
||||
class NotificationsManager |
||||
{ |
||||
public: |
||||
static void postNotification(const QString &room, |
||||
const QString &user, |
||||
const QString &message); |
||||
}; |
@ -0,0 +1,7 @@ |
||||
#include "notifications/Manager.h" |
||||
|
||||
void |
||||
NotificationsManager::postNotification(const QString &, const QString &, const QString &) |
||||
{ |
||||
// TODO: To be implemented
|
||||
} |
@ -0,0 +1,22 @@ |
||||
#include "notifications/Manager.h" |
||||
|
||||
#include <Foundation/Foundation.h> |
||||
#include <QtMac> |
||||
|
||||
@interface NSUserNotification (CFIPrivate) |
||||
- (void)set_identityImage:(NSImage *)image; |
||||
@end |
||||
|
||||
void |
||||
NotificationsManager::postNotification(const QString &roomName, const QString &userName, const QString &message) |
||||
{ |
||||
NSUserNotification * notif = [[NSUserNotification alloc] init]; |
||||
|
||||
notif.title = roomName.toNSString(); |
||||
notif.subtitle = QString("%1 sent a message").arg(userName).toNSString(); |
||||
notif.informativeText = message.toNSString(); |
||||
notif.soundName = NSUserNotificationDefaultSoundName; |
||||
|
||||
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification: notif]; |
||||
[notif autorelease]; |
||||
} |
@ -0,0 +1,7 @@ |
||||
#include "notifications/Manager.h" |
||||
|
||||
void |
||||
NotificationsManager::postNotification(const QString &, const QString &, const QString &) |
||||
{ |
||||
// TODO: To be implemented
|
||||
} |
Loading…
Reference in new issue