From 8379d9b27ebc8534f6b1dd1070bfe16181f6ce67 Mon Sep 17 00:00:00 2001 From: Travis La Marr Date: Mon, 2 Jan 2012 04:51:37 -0500 Subject: [PATCH] Fix #1: Add support for Supertoasty push service --- README.md | 5 ++++- logo.png | Bin 0 -> 1569 bytes push.cpp | 24 ++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 logo.png diff --git a/README.md b/README.md index 68a43cc..bfaa067 100644 --- a/README.md +++ b/README.md @@ -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" diff --git a/logo.png b/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..0a916ff477f1b73081435c461d6eff606d7efdba GIT binary patch literal 1569 zcmeAS@N?(olHy`uVBq!ia0vp^mLSZ*1|)kVnp=UCWQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2v2cW|hp4h>{3jAFJg2T)jk)8oi3#0-$aN1{?c|g2d$P)DnfH z)bz|eTc!8A_bVx6rr0WloBA5~7C5J7WO`H;r3P2|g(O#HCtIc{+1n}DR9FEG$W1Lt zRH(?!$t$+1uvG$^YXxM3g!Ppaz)DK8ZIvL7itr6kaLzAERWQ{v&`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D9WzmvO9U0#p00i_>zopr059KH2><{9 literal 0 HcmV?d00001 diff --git a/push.cpp b/push.cpp index 560e02d..6818b0c 100644 --- a/push.cpp +++ b/push.cpp @@ -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");