mirror of https://github.com/SeanOMik/znc-push.git
Merge pull request #85 from FruitieX/fruitiex/url_improvements
URL service improvements:
This commit is contained in:
commit
4fc6d45458
11
README.md
11
README.md
|
@ -237,12 +237,18 @@ to something similar to "http://domain/#channel/2011-03-09 14:25:09", or
|
|||
|
||||
This option must be set when using Boxcar or Pushover.
|
||||
|
||||
When using the custom URL service, if this option is set it will enable HTTP basic
|
||||
authentication and be used as username.
|
||||
|
||||
* `secret = ""`
|
||||
|
||||
Authentication token for push notifications.
|
||||
|
||||
This option must be set when using Notify My Android, Pushover, Prowl, Supertoasty or PushBullet.
|
||||
|
||||
When using the custom URL service, if this option is set it will enable HTTP basic
|
||||
authentication and be used as password.
|
||||
|
||||
* `target = ""`
|
||||
|
||||
Device or target name for push notifications.
|
||||
|
@ -281,6 +287,11 @@ to something similar to "http://domain/#channel/2011-03-09 14:25:09", or
|
|||
local scheme to access a mobile application. Keyword expansion is performed on this
|
||||
value.
|
||||
|
||||
* `message_uri_post = "no"`
|
||||
|
||||
When using the custom URL service, this option allows you to specify whether to use the
|
||||
POST method instead of GET.
|
||||
|
||||
* `message_uri_title` = ""`
|
||||
|
||||
If you're using Pushover.net, you can specify a title for the `message_uri` option.
|
||||
|
|
10
push.cpp
10
push.cpp
|
@ -132,6 +132,7 @@ class CPushMod : public CModule
|
|||
defaults["message_length"] = "100";
|
||||
defaults["message_title"] = "{title}";
|
||||
defaults["message_uri"] = "";
|
||||
defaults["message_uri_post"] = "no";
|
||||
defaults["message_uri_title"] = "";
|
||||
defaults["message_priority"] = "0";
|
||||
defaults["message_sound"] = "";
|
||||
|
@ -472,7 +473,10 @@ class CPushMod : public CModule
|
|||
return;
|
||||
}
|
||||
|
||||
if(options["message_uri_post"] != "yes")
|
||||
{
|
||||
use_post = false;
|
||||
}
|
||||
|
||||
if (parts[0] == "https")
|
||||
{
|
||||
|
@ -490,6 +494,12 @@ class CPushMod : public CModule
|
|||
return;
|
||||
}
|
||||
|
||||
// HTTP basic auth
|
||||
if(options["username"] != "" || options["secret"] != "")
|
||||
{
|
||||
service_auth = options["username"] + CString(":") + options["secret"];
|
||||
}
|
||||
|
||||
// Process the remaining portion of the URL
|
||||
url = parts[1];
|
||||
|
||||
|
|
Loading…
Reference in New Issue