From f3279c4497e80bd9497a1e2b834b1921dbf21d86 Mon Sep 17 00:00:00 2001 From: Tobias Markmann Date: Fri, 16 Oct 2015 13:05:42 +0200 Subject: 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 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 @@ -53,6 +53,11 @@ NotificationCenterNotifier::~NotificationCenterNotifier() { } void NotificationCenterNotifier::showMessage(Type type, const std::string& subject, const std::string& description, const boost::filesystem::path& picture, boost::function callback) { + std::vector defaultTypes = getDefaultTypes(); + if (std::find(defaultTypes.begin(), defaultTypes.end(), type) == defaultTypes.end()) { + return; + } + NSUserNotification* notification = [[NSUserNotification alloc] init]; notification.title = STD2NSSTRING(typeToString(type)); notification.subtitle = STD2NSSTRING(subject); -- cgit v0.10.2-6-g49f6