Bug 1088230 - Add backwards compatible registration payload to new rooms registration for Loop. r=Standard8
authorPaul Kerr [:pkerr] <pkerr@mozilla.com>
Thu, 23 Oct 2014 22:52:16 +0100
changeset 212124 fa426ab14a9c110e9708884ece5ec5f3fcd83345
parent 212123 54fab44be5f327fdb342eebc8860ce595b3c7c10
child 212125 286fddc30fdaa4b1e5be5274ca4bda06d573a151
push id27698
push usercbook@mozilla.com
push dateFri, 24 Oct 2014 13:53:50 +0000
treeherdermozilla-central@6e35802ae3e2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8
bugs1088230
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1088230 - Add backwards compatible registration payload to new rooms registration for Loop. r=Standard8
browser/components/loop/MozLoopService.jsm
--- a/browser/components/loop/MozLoopService.jsm
+++ b/browser/components/loop/MozLoopService.jsm
@@ -515,17 +515,23 @@ let MozLoopServiceInternal = {
    * Registers with the Loop server either as a guest or a FxA user.
    *
    * @param {LOOP_SESSION_TYPE} sessionType The type of session e.g. guest or FxA
    * @param {String} pushUrls The push url given by the push server.
    * @param {Boolean} [retry=true] Whether to retry if authentication fails.
    * @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
         // early return.
         if (!this.storeSessionToken(sessionType, response.headers)) {
           return;
         }