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 /SwifTools/Notifier
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
Diffstat (limited to 'SwifTools/Notifier')
-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
@@ -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<void ()> callback) {
+ std::vector<Notifier::Type> 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);