Merge pull request #170 from mathieupoussin/master

Add Pushalot support
This commit is contained in:
John Reese 2015-07-22 11:03:01 -07:00
commit 364cfccd1b
2 changed files with 34 additions and 0 deletions

View File

@ -21,6 +21,7 @@ conditions. ZNC Push current supports the following services:
* [Airgram][]
* [Faast][]
* [Nexmo][]
* [Pushalot][]
* Custom URL GET requests
This project is still a Work In Progress, but should be functional enough and stable enough
@ -517,6 +518,7 @@ from me and not from my employer. See the `LICENSE` file for details.
[Airgram]: http://airgramapp.com/
[Faast]: http://faast.io/
[Nexmo]: https://www.nexmo.com
[Pushalot]: https://pushalot.com/
[faq]: https://github.com/jreese/znc-push/blob/master/doc/faq.md
[examples]: https://github.com/jreese/znc-push/blob/master/doc/examples.md

View File

@ -406,6 +406,33 @@ class CPushMod : public CModule
params["priority"] = options["message_priority"];
}
}
else if (service == "pushalot")
{
if (options["secret"] == "")
{
PutModule("Error: secret (authorization token) not set");
return;
}
service_host = "pushalot.com";
service_url = "/api/sendmessage";
params["AuthorizationToken"] = options["secret"];
params["Title"] = message_title;
params["Body"] = message_content;
if (message_uri != "")
{
params["Link"] = message_uri;
}
if ( options["message_uri_title"] != "" )
{
params["LinkTitle"] = options["message_uri_title"];
}
}
else if (service == "prowl")
{
if (options["secret"] == "")
@ -1294,6 +1321,11 @@ class CPushMod : public CModule
{
PutModule("Note: Pushover requires setting both the 'username' (to user key) and the 'secret' (to application api key) option");
}
else if (value == "pushalot")
{
PutModule("Note: Pushalot requires setting the 'secret' (to user key) (to authorization token) option");
}
else if (value == "prowl")
{
PutModule("Note: Prowl requires setting the 'secret' option");