Merge pull request #38 from cocodelabs/kylef/remove-devices
authorDennis Collaris <redacted>
Sat, 2 Jul 2016 15:56:04 +0000 (17:56 +0200)
committerGitHub <redacted>
Sat, 2 Jul 2016 15:56:04 +0000 (17:56 +0200)
Remove devices when API returns 401

1  2 
palaver.cpp

diff --cc palaver.cpp
index 04a169c13f81fec9a55ab32cb6cfc9f632277879,372f0c20759419546b82d4a546c91ab47f89c469..8ffdd33e978a732fd7783adb00cf76bbd80a9e50
@@@ -671,12 -689,9 +689,12 @@@ public
                        const CString sNetworkID = GetNetworkID(*module.GetNetwork());
                        sJSON += ",\"network\": \"" + sNetworkID.Replace_n("\"", "\\\"") + "\"";
                }
 +              if (!sIntent.empty()) {
 +                      sJSON += ",\"intent\": \"" + sIntent + "\"";
 +              }
                sJSON += "}";
  
-               PLVHTTPSocket *pSocket = new PLVHTTPSocket(&module, "POST", GetPushEndpoint(), mcsHeaders, sJSON);
+               PLVHTTPSocket *pSocket = new PLVHTTPNotificationSocket(&module, GetToken(), "POST", GetPushEndpoint(), mcsHeaders, sJSON);
                module.AddSocket(pSocket);
        }
  
git clone https://git.99rst.org/PROJECT