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][]
* [Notify My Android][] (NMA)
* [Prowl][]
* [Supertoasty][]
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
@ -161,6 +162,7 @@ Configuration
* "notifo"
* "nma"
* "prowl"
* "supertoasty"
* `username = ""`
@ -172,7 +174,7 @@ Configuration
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
@ -340,6 +342,7 @@ This project is licensed under the MIT license. See the `LICENSE` file for deta
[Notifo]: http://notifo.com
[Notify My Android]: http://www.notifymyandroid.com
[Prowl]: http://www.prowlapp.com
[Supertoasty]: http://www.supertoasty.com
[mantis]: http://leetcode.net/mantis
[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["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
{
PutModule("Error: service type not selected");
@ -901,6 +921,10 @@ class CPushMod : public CModule
{
PutModule("Note: Prowl requires setting the 'secret' option");
}
else if (value == "supertoasty")
{
PutModule("Note: Supertoasty requires setting the 'secret' option with device id");
}
else
{
PutModule("Error: unknown service name");