summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'SwifTools/Notifier')
-rw-r--r--SwifTools/Notifier/GrowlNotifier.cpp15
-rw-r--r--SwifTools/Notifier/Notifier.cpp1
2 files changed, 7 insertions, 9 deletions
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::Type> Notifier::getAllTypes() {
std::vector<Notifier::Type> Notifier::getDefaultTypes() {
std::vector<Type> result;
- result.push_back(ContactAvailable);
result.push_back(IncomingMessage);
result.push_back(SystemMessage);
return result;