From 58e24cf33163d53e2f1e31af9f3229c927d8e5e3 Mon Sep 17 00:00:00 2001 From: John Reese Date: Mon, 23 Jul 2012 22:07:28 -0700 Subject: [PATCH] Fix #4: Add support for Pushover service --- README.md | 5 ++++- push.cpp | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0eba824..7654196 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ conditions. ZNC Push current supports the following services: * [Boxcar][] * [Notifo][] * [Notify My Android][] (NMA) +* [Pushover][] * [Prowl][] * [Supertoasty][] @@ -160,6 +161,7 @@ Configuration * "boxcar" * "notifo" * "nma" + * "pushover" * "prowl" * "supertoasty" @@ -173,7 +175,7 @@ Configuration Authentication token for push notifications. - This option must be set when using Notifo, Notify My Android, Prowl or Supertoasty. + This option must be set when using Notifo, Notify My Android, Pushover, Prowl or Supertoasty. ### Conditions @@ -340,6 +342,7 @@ This project is licensed under the MIT license. See the `LICENSE` file for deta [Boxcar]: http://boxcar.io [Notifo]: http://notifo.com [Notify My Android]: http://www.notifymyandroid.com +[Pushover]: http://pushover.net [Prowl]: http://www.prowlapp.com [Supertoasty]: http://www.supertoasty.com diff --git a/push.cpp b/push.cpp index 6818b0c..bef4151 100644 --- a/push.cpp +++ b/push.cpp @@ -283,6 +283,25 @@ class CPushMod : public CModule params["description"] = short_message; params["url"] = uri; } + else if (service == "pushover") + { + if (options["secret"] == "") + { + PutModule("Error: secret (user key) not set"); + return; + } + + CString pushover_api_token = "h6RToHDU7gNnB3IMyUb94SuwKtBzOD"; + + service_host = "api.pushover.net"; + service_url = "/1/messages.json"; + + params["token"] = pushover_api_token; + params["user"] = options["secret"]; + //params["device"] = short_message; + params["title"] = title; + params["message"] = short_message; + } else if (service == "prowl") { if (options["secret"] == "") @@ -917,6 +936,10 @@ class CPushMod : public CModule { PutModule("Note: NMA requires setting the 'secret' option"); } + else if (value == "pushover") + { + PutModule("Note: Pushover requires setting the 'secret' option"); + } else if (value == "prowl") { PutModule("Note: Prowl requires setting the 'secret' option");