From 9a960adf955b2af95ecd34b81b7a29c0ee9e5aa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Fri, 17 Sep 2010 12:27:36 +0200 Subject: By default, only show message notifications. diff --git a/SwifTools/Notifier/GrowlNotifier.cpp b/SwifTools/Notifier/GrowlNotifier.cpp index 0660910..3eb580a 100644 --- a/SwifTools/Notifier/GrowlNotifier.cpp +++ b/SwifTools/Notifier/GrowlNotifier.cpp @@ -10,6 +10,7 @@ #include "Swiften/Base/ByteArray.h" #include "SwifTools/Notifier/GrowlNotifier.h" +#include "Swiften/Base/foreach.h" #pragma GCC diagnostic ignored "-Wold-style-cast" @@ -48,17 +49,15 @@ namespace Swift { GrowlNotifier::GrowlNotifier(const String& name) { // All notifications CFMutableArrayRef allNotifications = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks); - CFArrayAppendValue(allNotifications, SWIFTEN_STRING_TO_CFSTRING(typeToString(ContactAvailable))); - CFArrayAppendValue(allNotifications, SWIFTEN_STRING_TO_CFSTRING(typeToString(ContactUnavailable))); - CFArrayAppendValue(allNotifications, SWIFTEN_STRING_TO_CFSTRING(typeToString(ContactStatusChange))); - CFArrayAppendValue(allNotifications, SWIFTEN_STRING_TO_CFSTRING(typeToString(IncomingMessage))); - CFArrayAppendValue(allNotifications, SWIFTEN_STRING_TO_CFSTRING(typeToString(SystemMessage))); + foreach(Type type, getAllTypes()) { + CFArrayAppendValue(allNotifications, SWIFTEN_STRING_TO_CFSTRING(typeToString(type))); + } // Default Notifications CFMutableArrayRef defaultNotifications = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks); - CFArrayAppendValue(defaultNotifications, SWIFTEN_STRING_TO_CFSTRING(typeToString(ContactAvailable))); - CFArrayAppendValue(defaultNotifications, SWIFTEN_STRING_TO_CFSTRING(typeToString(IncomingMessage))); - CFArrayAppendValue(defaultNotifications, SWIFTEN_STRING_TO_CFSTRING(typeToString(SystemMessage))); + foreach(Type type, getDefaultTypes()) { + CFArrayAppendValue(allNotifications, SWIFTEN_STRING_TO_CFSTRING(typeToString(type))); + } // Initialize delegate InitGrowlDelegate(&delegate_); diff --git a/SwifTools/Notifier/Notifier.cpp b/SwifTools/Notifier/Notifier.cpp index a976486..7a7ed13 100644 --- a/SwifTools/Notifier/Notifier.cpp +++ b/SwifTools/Notifier/Notifier.cpp @@ -35,7 +35,6 @@ std::vector Notifier::getAllTypes() { std::vector Notifier::getDefaultTypes() { std::vector result; - result.push_back(ContactAvailable); result.push_back(IncomingMessage); result.push_back(SystemMessage); return result; -- cgit v0.10.2-6-g49f6