mirror of https://github.com/SeanOMik/znc-push.git
Added better error checking for target
This commit is contained in:
parent
79572136ef
commit
ff4518cad8
15
push.cpp
15
push.cpp
|
@ -471,12 +471,17 @@ class CPushMod : public CModule
|
||||||
{
|
{
|
||||||
if (options["username"] == "")
|
if (options["username"] == "")
|
||||||
{
|
{
|
||||||
PutModule("Error: username (user key) not set");
|
PutModule("Error: username (api key) not set");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (options["secret"] == "")
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -486,12 +491,8 @@ class CPushMod : public CModule
|
||||||
params["api_secret"] = options["secret"];
|
params["api_secret"] = options["secret"];
|
||||||
params["api_key"] = options["username"];
|
params["api_key"] = options["username"];
|
||||||
params["from"] = message_title;
|
params["from"] = message_title;
|
||||||
params["text"] = message_content;
|
|
||||||
|
|
||||||
if (options["target"] != "")
|
|
||||||
{
|
|
||||||
params["to"] = options["target"];
|
params["to"] = options["target"];
|
||||||
}
|
params["text"] = message_content;
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (service == "url")
|
else if (service == "url")
|
||||||
|
|
Loading…
Reference in New Issue