Added Boxcar 2 support

This commit is contained in:
Ryan Collins 2014-04-23 09:49:48 -04:00
parent 9d7e6ea8f2
commit 5f919beaa3
2 changed files with 28 additions and 2 deletions

View File

@ -6,6 +6,7 @@ services for any private message or channel highlight that matches a configurabl
conditions. ZNC Push current supports the following services: conditions. ZNC Push current supports the following services:
* [Boxcar][] * [Boxcar][]
* [Boxcar 2][]
* [Notify My Android][] (NMA) * [Notify My Android][] (NMA)
* [Pushover][] * [Pushover][]
* [Prowl][] * [Prowl][]
@ -292,8 +293,9 @@ to something similar to "http://domain/#channel/2011-03-09 14:25:09", or
* `message_sound = ""` * `message_sound = ""`
Notification sound to play with the push notification. Notification sound to play with the push notification.
Currently only supported by Pushover.net. Must be chosen from their list of Supported under Pushover, Faast, and Boxcar 2. Must be chosen from the list of
[supported sounds](https://pushover.net/api#sounds). [Pushover sounds](https://pushover.net/api#sounds), [Faast sounds](http://developer.faast.io/)
or [Boxcar 2 sounds](https://boxcar.uservoice.com/knowledgebase/articles/306788-how-to-send-your-boxcar-account-a-notification).
### Conditions ### Conditions
@ -426,6 +428,7 @@ This project is licensed under the MIT license. See the `LICENSE` file for deta
[Boxcar]: http://boxcar.io [Boxcar]: http://boxcar.io
[Boxcar 2]: http://boxcar.io
[Notify My Android]: http://www.notifymyandroid.com [Notify My Android]: http://www.notifymyandroid.com
[Pushover]: http://pushover.net [Pushover]: http://pushover.net
[Prowl]: http://www.prowlapp.com [Prowl]: http://www.prowlapp.com

View File

@ -302,6 +302,25 @@ class CPushMod : public CModule
params["notification[message]"] = message_content; params["notification[message]"] = message_content;
params["notification[source_url]"] = message_uri; params["notification[source_url]"] = message_uri;
} }
else if (service == "boxcar2")
{
if (options["secret"] == "")
{
PutModule("Error: secret not set to apikey");
return;
}
service_host = "new.boxcar.io";
service_url = "/api/notifications";
params["user_credentials"] = options["secret"];
params["notification[title]"] = message_title;
params["notification[long_message]"] = message_content;
if ( options["message_sound"] != "" )
{
params["notification[sound]"] = options["message_sound"];
}
}
else if (service == "nma") else if (service == "nma")
{ {
if (options["secret"] == "") if (options["secret"] == "")
@ -1129,6 +1148,10 @@ class CPushMod : public CModule
{ {
PutModule("Note: Boxcar requires setting the 'username' option"); PutModule("Note: Boxcar requires setting the 'username' option");
} }
else if (value == "boxcar2")
{
PutModule("Note: Boxcar 2 requires setting the 'secret' option");
}
else if (value == "nma") else if (value == "nma")
{ {
PutModule("Note: NMA requires setting the 'secret' option"); PutModule("Note: NMA requires setting the 'secret' option");