From 98aaa3a2292989f05f5c3e683e2dd4f20bb145e3 Mon Sep 17 00:00:00 2001 From: Tomasz Sterna Date: Fri, 19 Jun 2015 13:23:55 +0200 Subject: Notifications debugging via magic cookies --- daemon/manager.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'daemon/manager.cpp') diff --git a/daemon/manager.cpp b/daemon/manager.cpp index f9bd7be..b02264e 100644 --- a/daemon/manager.cpp +++ b/daemon/manager.cpp @@ -259,6 +259,36 @@ void Manager::applyProfile() } } +void Manager::ping(uint val) +{ + qCDebug(l) << "ping" << val; + + if (settings->property("debug").toBool()) { + // magic here! + // I do not want to add specific debugging methods to pebbled + // so just provide some magic Ping() method handling here :-) + switch (val) { + case 128: + watch->sendSMSNotification("SMS", "lorem ipsum"); + return; + case 129: + watch->sendEmailNotification("e-mail", "lorem ipsum", "subject"); + return; + case 130: + watch->sendFacebookNotification("Facebook", "lorem ipsum"); + return; + case 131: + watch->sendTwitterNotification("Twitter", "lorem ipsum"); + return; + case 132: + watch->sendMusicNowPlaying("artist", "album", "track name"); + return; + } + } + + watch->ping(val); +} + void Manager::transliterateMessage(const QString &text) { if (transliterator.isNull()) { -- cgit v1.2.3