From ea8c52e766352f6009bddd9681a5d69ae4094636 Mon Sep 17 00:00:00 2001 From: John Reese Date: Wed, 25 Jul 2012 16:22:10 -0700 Subject: [PATCH] Fix #6: Add 'target' option to support Pushover devices --- README.md | 7 +++++++ push.cpp | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 04814ea..6595b3e 100644 --- a/README.md +++ b/README.md @@ -177,6 +177,13 @@ Configuration This option must be set when using Notifo, Notify My Android, Pushover, Prowl or Supertoasty. +* `target = ""` + + Device or target name for push notifications. + + When using Pushover, this option allows you to specify a single device name to send + notifications to; if blank or unset, notifications will be sent to all devices. + ### Conditions diff --git a/push.cpp b/push.cpp index bef4151..ba469c1 100644 --- a/push.cpp +++ b/push.cpp @@ -114,6 +114,7 @@ class CPushMod : public CModule defaults["service"] = ""; defaults["username"] = ""; defaults["secret"] = ""; + defaults["target"] = ""; // Condition strings defaults["channel_conditions"] = "all"; @@ -298,9 +299,13 @@ class CPushMod : public CModule params["token"] = pushover_api_token; params["user"] = options["secret"]; - //params["device"] = short_message; params["title"] = title; params["message"] = short_message; + + if (options["target"] != "") + { + params["device"] = options["target"]; + } } else if (service == "prowl") {