Bug 1088230 - Add backwards compatible registration payload to new rooms registration for Loop. r=Standard8

This commit is contained in:
Paul Kerr [:pkerr] 2014-10-23 22:52:16 +01:00
parent 32e8214520
commit 822b313a5b

View File

@ -520,7 +520,13 @@ let MozLoopServiceInternal = {
* @return {Promise}
*/
registerWithLoopServer: function(sessionType, pushUrls, retry = true) {
return this.hawkRequest(sessionType, "/registration", "POST", { simplePushURLs: pushUrls})
// create a registration payload with a backwards compatible attribute (simplePushURL)
// that will register only the calls notification.
let msg = {
simplePushURL: pushUrls.calls,
simplePushURLs: pushUrls
};
return this.hawkRequest(sessionType, "/registration", "POST", msg)
.then((response) => {
// If this failed we got an invalid token. storeSessionToken rejects
// the gRegisteredDeferred promise for us, so here we just need to