mirror of https://github.com/SeanOMik/znc-push.git
Merge pull request #222 from appzer/master
add Pushsafer notification service
This commit is contained in:
commit
27dbd7e628
13
README.md
13
README.md
|
@ -15,6 +15,7 @@ conditions. ZNC Push current supports the following services:
|
|||
* [Boxcar 2][]
|
||||
* [Notify My Android][] (NMA)
|
||||
* [Pushover][]
|
||||
* [Pushsafer][]
|
||||
* [Prowl][]
|
||||
* [Supertoasty][]
|
||||
* [PushBullet][]
|
||||
|
@ -244,6 +245,7 @@ to something similar to "http://domain/#channel/2011-03-09 14:25:09", or
|
|||
* `boxcar`
|
||||
* `nma`
|
||||
* `pushover`
|
||||
* `pushsafer`
|
||||
* `prowl`
|
||||
* `supertoasty`
|
||||
* `pushbullet`
|
||||
|
@ -266,7 +268,7 @@ to something similar to "http://domain/#channel/2011-03-09 14:25:09", or
|
|||
|
||||
Authentication token for push notifications.
|
||||
|
||||
This option must be set when using Notify My Android, Pushover, Prowl, Supertoasty, PushBullet, Nexmo, Pushjet, or Telegram.
|
||||
This option must be set when using Notify My Android, Pushover, Pushsafer, Prowl, Supertoasty, PushBullet, Nexmo, Pushjet, or Telegram.
|
||||
|
||||
When using the custom URL service, if this option is set it will enable HTTP basic
|
||||
authentication and be used as password.
|
||||
|
@ -285,6 +287,8 @@ to something similar to "http://domain/#channel/2011-03-09 14:25:09", or
|
|||
|
||||
When using Telegram, this is the id of the chat that receives the message.
|
||||
|
||||
When using Pushsafer, this is the id or group id of your devices.
|
||||
|
||||
|
||||
### Notifications
|
||||
|
||||
|
@ -323,7 +327,7 @@ to something similar to "http://domain/#channel/2011-03-09 14:25:09", or
|
|||
|
||||
* `message_uri_title` Default: ` `
|
||||
|
||||
If you're using Pushover.net, you can specify a title for the `message_uri` option.
|
||||
If you're using Pushover.net or Pushsafer.com, you can specify a title for the `message_uri` option.
|
||||
|
||||
* `message_priority` Default: ` `
|
||||
|
||||
|
@ -333,9 +337,7 @@ to something similar to "http://domain/#channel/2011-03-09 14:25:09", or
|
|||
* `message_sound` Default: ` `
|
||||
|
||||
Notification sound to play with the push notification.
|
||||
Supported under Pushover, Faast, and Boxcar 2. Must be chosen from the list of
|
||||
[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).
|
||||
Supported under Pushover, Pushsafer, Faast, and Boxcar 2. Must be chosen from the list of [Pushover sounds](https://pushover.net/api#sounds), [Pushsafer sounds](https://www.pushsafer.com/en/pushapi), [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
|
||||
|
@ -528,6 +530,7 @@ from me and not from my employer. See the `LICENSE` file for details.
|
|||
[Boxcar 2]: http://boxcar.io
|
||||
[Notify My Android]: http://www.notifymyandroid.com
|
||||
[Pushover]: http://pushover.net
|
||||
[Pushsafer]: http://www.pushsafer.com
|
||||
[Prowl]: http://www.prowlapp.com
|
||||
[Supertoasty]: http://www.supertoasty.com
|
||||
[PushBullet]: https://www.pushbullet.com/
|
||||
|
|
44
push.cpp
44
push.cpp
|
@ -411,7 +411,42 @@ class CPushMod : public CModule
|
|||
params["priority"] = options["message_priority"];
|
||||
}
|
||||
}
|
||||
else if (service == "pushsafer")
|
||||
{
|
||||
if (options["secret"] == "")
|
||||
{
|
||||
PutModule("Error: privatekey (private or alias key) not set");
|
||||
return;
|
||||
}
|
||||
|
||||
service_host = "pushsafer.com";
|
||||
service_url = "/api";
|
||||
|
||||
params["k"] = options["secret"];
|
||||
params["t"] = message_title;
|
||||
params["m"] = message_content;
|
||||
|
||||
if (message_uri != "")
|
||||
{
|
||||
params["u"] = message_uri;
|
||||
}
|
||||
|
||||
if (options["message_uri_title"] != "" )
|
||||
{
|
||||
params["ut"] = options["message_uri_title"];
|
||||
}
|
||||
|
||||
if (options["target"] != "")
|
||||
{
|
||||
params["d"] = options["target"];
|
||||
}
|
||||
|
||||
if (options["message_sound"] != "" )
|
||||
{
|
||||
params["s"] = options["message_sound"];
|
||||
}
|
||||
|
||||
}
|
||||
else if (service == "pushalot")
|
||||
{
|
||||
if (options["secret"] == "")
|
||||
|
@ -432,12 +467,11 @@ class CPushMod : public CModule
|
|||
params["Link"] = message_uri;
|
||||
}
|
||||
|
||||
if ( options["message_uri_title"] != "" )
|
||||
if (options["message_uri_title"] != "" )
|
||||
{
|
||||
params["LinkTitle"] = options["message_uri_title"];
|
||||
}
|
||||
}
|
||||
|
||||
else if (service == "prowl")
|
||||
{
|
||||
if (options["secret"] == "")
|
||||
|
@ -527,7 +561,6 @@ class CPushMod : public CModule
|
|||
params["from"] = message_title;
|
||||
params["to"] = options["target"];
|
||||
params["text"] = message_content;
|
||||
|
||||
}
|
||||
else if (service == "url")
|
||||
{
|
||||
|
@ -1383,11 +1416,14 @@ 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 == "pushsafer")
|
||||
{
|
||||
PutModule("Note: Pushsafer requires setting the 'private or alias 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");
|
||||
|
|
Loading…
Reference in New Issue