Fix #1: Add support for Supertoasty push service

This commit is contained in:
Travis La Marr 2012-01-02 04:51:37 -05:00 committed by John Reese
parent cb427730e4
commit 8379d9b27e
3 changed files with 28 additions and 1 deletions

View File

@ -9,6 +9,7 @@ conditions. ZNC Push current supports the following services:
* [Notifo][] * [Notifo][]
* [Notify My Android][] (NMA) * [Notify My Android][] (NMA)
* [Prowl][] * [Prowl][]
* [Supertoasty][]
This project is still a Work In Progress, but should be functional enough and stable enough This project is still a Work In Progress, but should be functional enough and stable enough
for everyday usage. Users are more than welcome to submit feature requests or patches for for everyday usage. Users are more than welcome to submit feature requests or patches for
@ -161,6 +162,7 @@ Configuration
* "notifo" * "notifo"
* "nma" * "nma"
* "prowl" * "prowl"
* "supertoasty"
* `username = ""` * `username = ""`
@ -172,7 +174,7 @@ Configuration
Authentication token for push notifications. Authentication token for push notifications.
This option must be set when using Notifo, Notify My Android, or Prowl. This option must be set when using Notifo, Notify My Android, Prowl or Supertoasty.
### Conditions ### Conditions
@ -340,6 +342,7 @@ This project is licensed under the MIT license. See the `LICENSE` file for deta
[Notifo]: http://notifo.com [Notifo]: http://notifo.com
[Notify My Android]: http://www.notifymyandroid.com [Notify My Android]: http://www.notifymyandroid.com
[Prowl]: http://www.prowlapp.com [Prowl]: http://www.prowlapp.com
[Supertoasty]: http://www.supertoasty.com
[mantis]: http://leetcode.net/mantis [mantis]: http://leetcode.net/mantis
[ZNC]: http://en.znc.in "ZNC, an advanced IRC bouncer" [ZNC]: http://en.znc.in "ZNC, an advanced IRC bouncer"

BIN
logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -300,6 +300,26 @@ class CPushMod : public CModule
params["description"] = short_message; params["description"] = short_message;
params["url"] = uri; params["url"] = uri;
} }
else if (service == "supertoasty")
{
if (options["secret"] == "")
{
PutModule("Error: secret (device id) not set");
return;
}
use_post = false;
use_port = 80;
use_ssl = false;
service_host = "api.supertoasty.com";
service_url = "/notify/"+options["secret"];
params["title"] = title;
params["text"] = short_message;
params["image"] = "https://github.com/jreese/znc-push/raw/supertoasty/logo.png";
params["sender"] = "ZNC Push";
}
else else
{ {
PutModule("Error: service type not selected"); PutModule("Error: service type not selected");
@ -901,6 +921,10 @@ class CPushMod : public CModule
{ {
PutModule("Note: Prowl requires setting the 'secret' option"); PutModule("Note: Prowl requires setting the 'secret' option");
} }
else if (value == "supertoasty")
{
PutModule("Note: Supertoasty requires setting the 'secret' option with device id");
}
else else
{ {
PutModule("Error: unknown service name"); PutModule("Error: unknown service name");