summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2015-10-16 11:05:42 (GMT)
committerTobias Markmann <tm@ayena.de>2015-10-16 13:13:36 (GMT)
commitf3279c4497e80bd9497a1e2b834b1921dbf21d86 (patch)
tree7d4bded47a12e5b9529b35234d8d03e3ac1334f2
parent907fdbdab74b72cc4fde2425dc9b2d4d461daf66 (diff)
downloadswift-f3279c4497e80bd9497a1e2b834b1921dbf21d86.zip
swift-f3279c4497e80bd9497a1e2b834b1921dbf21d86.tar.bz2
Only show default notifications in OS X Notification Center
Test-Information: Verified behavior on OS X 10.10.5 with two accounts, presence changes and message exchanges. Change-Id: I79b4b8a92076dfb4c2d65f91bfb2f808cf7821d5
-rw-r--r--SwifTools/Notifier/NotificationCenterNotifier.mm5
1 files changed, 5 insertions, 0 deletions
diff --git a/SwifTools/Notifier/NotificationCenterNotifier.mm b/SwifTools/Notifier/NotificationCenterNotifier.mm
index df092ff..28cacb6 100644
--- a/SwifTools/Notifier/NotificationCenterNotifier.mm
+++ b/SwifTools/Notifier/NotificationCenterNotifier.mm
@@ -51,10 +51,15 @@ NotificationCenterNotifier::~NotificationCenterNotifier() {
51 [[NSUserNotificationCenter defaultUserNotificationCenter] setDelegate: nil]; 51 [[NSUserNotificationCenter defaultUserNotificationCenter] setDelegate: nil];
52 p->callbacksForNotifications.clear(); 52 p->callbacksForNotifications.clear();
53} 53}
54 54
55void NotificationCenterNotifier::showMessage(Type type, const std::string& subject, const std::string& description, const boost::filesystem::path& picture, boost::function<void ()> callback) { 55void NotificationCenterNotifier::showMessage(Type type, const std::string& subject, const std::string& description, const boost::filesystem::path& picture, boost::function<void ()> callback) {
56 std::vector<Notifier::Type> defaultTypes = getDefaultTypes();
57 if (std::find(defaultTypes.begin(), defaultTypes.end(), type) == defaultTypes.end()) {
58 return;
59 }
60
56 NSUserNotification* notification = [[NSUserNotification alloc] init]; 61 NSUserNotification* notification = [[NSUserNotification alloc] init];
57 notification.title = STD2NSSTRING(typeToString(type)); 62 notification.title = STD2NSSTRING(typeToString(type));
58 notification.subtitle = STD2NSSTRING(subject); 63 notification.subtitle = STD2NSSTRING(subject);
59 notification.informativeText = STD2NSSTRING(description); 64 notification.informativeText = STD2NSSTRING(description);
60 notification.contentImage = [[NSImage alloc] initWithContentsOfFile: STD2NSSTRING(picture.string())]; 65 notification.contentImage = [[NSImage alloc] initWithContentsOfFile: STD2NSSTRING(picture.string())];