mirror of https://github.com/SeanOMik/znc-push.git
Add Pushjet support
This commit is contained in:
parent
878af545ac
commit
769fb80c48
|
@ -22,6 +22,7 @@ conditions. ZNC Push current supports the following services:
|
|||
* [Faast][]
|
||||
* [Nexmo][]
|
||||
* [Pushalot][]
|
||||
* [Pushjet][]
|
||||
* Custom URL GET requests
|
||||
|
||||
This project is still a Work In Progress, but should be functional enough and stable enough
|
||||
|
@ -241,6 +242,7 @@ to something similar to "http://domain/#channel/2011-03-09 14:25:09", or
|
|||
* `pushbullet`
|
||||
* `airgram`
|
||||
* `nexmo`
|
||||
* `pushjet`
|
||||
* `url`
|
||||
|
||||
* `username` Default: ` `
|
||||
|
@ -256,7 +258,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, Airgram authenticated services, PushBullet, or Nexmo.
|
||||
This option must be set when using Notify My Android, Pushover, Prowl, Supertoasty, Airgram authenticated services, PushBullet, Nexmo or Pushjet.
|
||||
|
||||
When using the custom URL service, if this option is set it will enable HTTP basic
|
||||
authentication and be used as password.
|
||||
|
@ -318,7 +320,7 @@ to something similar to "http://domain/#channel/2011-03-09 14:25:09", or
|
|||
* `message_priority` Default: ` `
|
||||
|
||||
Priority level that will be used for the push notification.
|
||||
Currently supported only by Pushover.net and Notify My Android.
|
||||
Currently supported only by Pushover.net, Notify My Android and Pushjet.
|
||||
|
||||
* `message_sound` Default: ` `
|
||||
|
||||
|
@ -525,6 +527,7 @@ from me and not from my employer. See the `LICENSE` file for details.
|
|||
[Faast]: http://faast.io/
|
||||
[Nexmo]: https://www.nexmo.com
|
||||
[Pushalot]: https://pushalot.com/
|
||||
[Pushjet]: http://pushjet.io
|
||||
|
||||
[faq]: https://github.com/jreese/znc-push/blob/master/doc/faq.md
|
||||
[examples]: https://github.com/jreese/znc-push/blob/master/doc/examples.md
|
||||
|
|
29
push.cpp
29
push.cpp
|
@ -651,6 +651,31 @@ class CPushMod : public CModule
|
|||
|
||||
PutDebug("payload: " + params["payload"]);
|
||||
}
|
||||
else if (service == "pushjet")
|
||||
{
|
||||
if (options["secret"] == "")
|
||||
{
|
||||
PutModule("Error: secret (service key) not set");
|
||||
return;
|
||||
}
|
||||
|
||||
service_host = "api.pushjet.io";
|
||||
service_url = "/message";
|
||||
|
||||
params["secret"] = options["secret"];
|
||||
params["title"] = message_title;
|
||||
params["message"] = message_content;
|
||||
|
||||
if (message_uri != "")
|
||||
{
|
||||
params["link"] = message_uri;
|
||||
}
|
||||
|
||||
if (options["message_priority"] != "")
|
||||
{
|
||||
params["level"] = options["message_priority"];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
PutModule("Error: service type not selected");
|
||||
|
@ -1384,6 +1409,10 @@ class CPushMod : public CModule
|
|||
{
|
||||
PutModule("Note: Slack requires setting 'secret' (from webhook) and 'target' (channel or username), optional 'username' (bot name)");
|
||||
}
|
||||
else if (value == "pushjet")
|
||||
{
|
||||
PutModule("Note: Pushjet requires setting 'secret' (service key) option");
|
||||
}
|
||||
else
|
||||
{
|
||||
PutModule("Error: unknown service name");
|
||||
|
|
Loading…
Reference in New Issue