From be540b540c37feed69f94f1d5bc37cd76d23b826 Mon Sep 17 00:00:00 2001 From: Jake Watkins Date: Tue, 30 Jul 2013 10:25:46 -0700 Subject: [PATCH] Remove hardcoded pushover app key; use username/secert for user/token instead --- README.md | 2 +- push.cpp | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 7d15b15..08d042c 100644 --- a/README.md +++ b/README.md @@ -200,7 +200,7 @@ to something similar to "http://domain/#channel/2011-03-09 14:25:09", or User account that should receive push notifications. - This option must be set when using Boxcar or Notifo. + This option must be set when using Boxcar, Pushover or Notifo. * `secret = ""` diff --git a/push.cpp b/push.cpp index f36650e..0d1e417 100644 --- a/push.cpp +++ b/push.cpp @@ -309,19 +309,22 @@ class CPushMod : public CModule } else if (service == "pushover") { - if (options["secret"] == "") + if (options["username"] == "") { - PutModule("Error: secret (user key) not set"); + PutModule("Error: username (user key) not set"); + return; + } + if (options["secret"] == "") + { + PutModule("Error: secret (application token/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["token"] = options["secret"]; + params["user"] = options["username"]; params["title"] = message_title; params["message"] = message_content;