Fix #91: Update pushbullet to api v2

This commit is contained in:
John Reese 2014-05-16 11:44:37 -07:00
parent 055fc3981d
commit 8c814bfacc
1 changed files with 8 additions and 4 deletions

View File

@ -267,19 +267,23 @@ class CPushMod : public CModule
// Service-specific profiles
if (service == "pushbullet")
{
if (options["target"] == "" || options["secret"] == "")
if (options["secret"] == "")
{
PutModule("Error: target (device id) or secret (api key) not set");
PutModule("Error: secret (api key) not set");
return;
}
service_host = "api.pushbullet.com";
service_url = "/api/pushes";
service_url = "/v2/pushes";
// BASIC auth, base64-encoded APIKey:
service_auth = options["secret"] + CString(":");
params["device_iden"] = options["target"];
if (options["target"] != "")
{
params["device_iden"] = options["target"];
}
params["type"] = "note";
params["title"] = message_title;
params["body"] = message_content;