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 // Service-specific profiles
if (service == "pushbullet") 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; return;
} }
service_host = "api.pushbullet.com"; service_host = "api.pushbullet.com";
service_url = "/api/pushes"; service_url = "/v2/pushes";
// BASIC auth, base64-encoded APIKey: // BASIC auth, base64-encoded APIKey:
service_auth = options["secret"] + CString(":"); service_auth = options["secret"] + CString(":");
if (options["target"] != "")
{
params["device_iden"] = options["target"]; params["device_iden"] = options["target"];
}
params["type"] = "note"; params["type"] = "note";
params["title"] = message_title; params["title"] = message_title;
params["body"] = message_content; params["body"] = message_content;