From ff4518cad80187b2795f8641a34b6ce5eed43aff Mon Sep 17 00:00:00 2001 From: Erhan Justice Date: Wed, 15 Oct 2014 18:33:15 -0700 Subject: [PATCH] Added better error checking for target --- push.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/push.cpp b/push.cpp index cd0f6d2..cf793b7 100755 --- a/push.cpp +++ b/push.cpp @@ -471,12 +471,17 @@ class CPushMod : public CModule { if (options["username"] == "") { - PutModule("Error: username (user key) not set"); + PutModule("Error: username (api key) not set"); return; } if (options["secret"] == "") { - PutModule("Error: secret (application token/key) not set"); + PutModule("Error: secret (api secret) not set"); + return; + } + if (options["target"] == "") + { + PutModule("Error: destination mobile number (in international format) not set"); return; } @@ -486,13 +491,9 @@ class CPushMod : public CModule params["api_secret"] = options["secret"]; params["api_key"] = options["username"]; params["from"] = message_title; + params["to"] = options["target"]; params["text"] = message_content; - - if (options["target"] != "") - { - params["to"] = options["target"]; - } - + } else if (service == "url") {