From 31721d1eca5cc085cb34339f6940ce7db2c464e9 Mon Sep 17 00:00:00 2001 From: Kevin Siml Date: Sun, 26 Feb 2017 22:32:26 +0100 Subject: [PATCH 1/5] Update push.cpp --- push.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/push.cpp b/push.cpp index 591292c..dafc080 100755 --- a/push.cpp +++ b/push.cpp @@ -1383,6 +1383,10 @@ 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"); From 4bf46901fa67d6910cf25a7c8c8ac4af59d2b616 Mon Sep 17 00:00:00 2001 From: Kevin Siml Date: Sun, 26 Feb 2017 23:08:47 +0100 Subject: [PATCH 2/5] Update README.md --- README.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1e1045e..ebea5bb 100755 --- a/README.md +++ b/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. @@ -284,6 +286,8 @@ to something similar to "http://domain/#channel/2011-03-09 14:25:09", or number. The number must be in international format. 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,9 @@ 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/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 +532,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/ From a432dbf449fe0abc8a2a74ebd84acde6d5b19733 Mon Sep 17 00:00:00 2001 From: Kevin Siml Date: Sun, 26 Feb 2017 23:10:46 +0100 Subject: [PATCH 3/5] Update push.cpp --- push.cpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/push.cpp b/push.cpp index dafc080..f1af087 100755 --- a/push.cpp +++ b/push.cpp @@ -411,6 +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") { From 333a401e7994a05b2769f62e6c97e4842a94ff51 Mon Sep 17 00:00:00 2001 From: Kevin Siml Date: Mon, 27 Feb 2017 09:16:41 +0100 Subject: [PATCH 4/5] Update push.cpp --- push.cpp | 82 +++++++++++++++++++++++++++----------------------------- 1 file changed, 39 insertions(+), 43 deletions(-) diff --git a/push.cpp b/push.cpp index f1af087..f7a6c9a 100755 --- a/push.cpp +++ b/push.cpp @@ -431,7 +431,7 @@ class CPushMod : public CModule params["u"] = message_uri; } - if ( options["message_uri_title"] != "" ) + if (options["message_uri_title"] != "" ) { params["ut"] = options["message_uri_title"]; } @@ -441,20 +441,19 @@ class CPushMod : public CModule params["d"] = options["target"]; } - if ( options["message_sound"] != "" ) + if (options["message_sound"] != "" ) { params["s"] = options["message_sound"]; } } - else if (service == "pushalot") - { + { if (options["secret"] == "") - { - PutModule("Error: secret (authorization token) not set"); - return; - } + { + PutModule("Error: secret (authorization token) not set"); + return; + } service_host = "pushalot.com"; service_url = "/api/sendmessage"; @@ -464,16 +463,15 @@ class CPushMod : public CModule params["Body"] = message_content; if (message_uri != "") - { - params["Link"] = message_uri; - } - - if ( options["message_uri_title"] != "" ) - { - params["LinkTitle"] = options["message_uri_title"]; - } - } + { + params["Link"] = message_uri; + } + if (options["message_uri_title"] != "" ) + { + params["LinkTitle"] = options["message_uri_title"]; + } + } else if (service == "prowl") { if (options["secret"] == "") @@ -539,31 +537,30 @@ class CPushMod : public CModule } else if (service == "nexmo") { - if (options["username"] == "") - { - PutModule("Error: username (api key) not set"); - return; - } - if (options["secret"] == "") - { - PutModule("Error: secret (api secret) not set"); - return; - } - if (options["target"] == "") - { - PutModule("Error: destination mobile number (in international format) not set"); - return; - } + if (options["username"] == "") + { + PutModule("Error: username (api key) not set"); + return; + } + if (options["secret"] == "") + { + PutModule("Error: secret (api secret) not set"); + return; + } + if (options["target"] == "") + { + PutModule("Error: destination mobile number (in international format) not set"); + return; + } - service_host = "rest.nexmo.com"; - service_url = "/sms/json"; - - params["api_secret"] = options["secret"]; - params["api_key"] = options["username"]; - params["from"] = message_title; - params["to"] = options["target"]; - params["text"] = message_content; + service_host = "rest.nexmo.com"; + service_url = "/sms/json"; + params["api_secret"] = options["secret"]; + params["api_key"] = options["username"]; + params["from"] = message_title; + params["to"] = options["target"]; + params["text"] = message_content; } else if (service == "url") { @@ -1424,10 +1421,9 @@ class CPushMod : public CModule 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"); From 1cbc4f1357b898aa9c66e536cea2fc9153f688b7 Mon Sep 17 00:00:00 2001 From: Kevin Siml Date: Mon, 27 Feb 2017 14:17:46 +0100 Subject: [PATCH 5/5] Update README.md --- README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ebea5bb..862d770 100755 --- a/README.md +++ b/README.md @@ -245,7 +245,7 @@ to something similar to "http://domain/#channel/2011-03-09 14:25:09", or * `boxcar` * `nma` * `pushover` - * `pushsafer` + * `pushsafer` * `prowl` * `supertoasty` * `pushbullet` @@ -279,7 +279,7 @@ to something similar to "http://domain/#channel/2011-03-09 14:25:09", or When using Pushover or PushBullet, this option allows you to specify a single device to send notifications to; if blank or unset, notifications - will be sent to all devices. For Pushover, this is the device name; for + will be sent to all devices. For Pushover, this is the device name; for PushBullet, this is the device_iden. When using Nexmo, this option allows you to specify the SMS destination @@ -287,7 +287,7 @@ 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. + When using Pushsafer, this is the id or group id of your devices. ### Notifications @@ -337,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, 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/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). + 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