Fix #6: Add 'target' option to support Pushover devices

This commit is contained in:
John Reese 2012-07-25 16:22:10 -07:00
parent 2806967e02
commit ea8c52e766
2 changed files with 13 additions and 1 deletions

View File

@ -177,6 +177,13 @@ Configuration
This option must be set when using Notifo, Notify My Android, Pushover, Prowl or Supertoasty. 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 ### Conditions

View File

@ -114,6 +114,7 @@ class CPushMod : public CModule
defaults["service"] = ""; defaults["service"] = "";
defaults["username"] = ""; defaults["username"] = "";
defaults["secret"] = ""; defaults["secret"] = "";
defaults["target"] = "";
// Condition strings // Condition strings
defaults["channel_conditions"] = "all"; defaults["channel_conditions"] = "all";
@ -298,9 +299,13 @@ class CPushMod : public CModule
params["token"] = pushover_api_token; params["token"] = pushover_api_token;
params["user"] = options["secret"]; params["user"] = options["secret"];
//params["device"] = short_message;
params["title"] = title; params["title"] = title;
params["message"] = short_message; params["message"] = short_message;
if (options["target"] != "")
{
params["device"] = options["target"];
}
} }
else if (service == "prowl") else if (service == "prowl")
{ {