Bug 1147375 - Don't fall over if roomName isn't supplied, let users continue to use Loop. r=mikedeboer
authorMark Banner <standard8@mozilla.com>
Thu, 26 Mar 2015 19:21:10 +0000
changeset 264709 c2c24e1903f45db035462d803ee765203cc0acaf
parent 264708 a10fbddc674ce5a5aac54f949d870bfbf4f0e718
child 264710 a83feceee78bdee65a321a741dcc7da291ef40e2
push id4718
push userraliiev@mozilla.com
push dateMon, 11 May 2015 18:39:53 +0000
treeherdermozilla-beta@c20c4ef55f08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmikedeboer
bugs1147375
milestone39.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 1147375 - Don't fall over if roomName isn't supplied, let users continue to use Loop. r=mikedeboer
browser/components/loop/MozLoopService.jsm
browser/components/loop/content/shared/js/actions.js
browser/components/loop/content/shared/js/roomStore.js
browser/components/loop/standalone/content/js/standaloneMozLoop.js
--- a/browser/components/loop/MozLoopService.jsm
+++ b/browser/components/loop/MozLoopService.jsm
@@ -1112,17 +1112,18 @@ this.MozLoopService = {
       if (MozLoopServiceInternal.doNotDisturb || participant.owner) {
         return;
       }
 
       let window = gWM.getMostRecentWindow("navigator:browser");
       if (window) {
         window.LoopUI.showNotification({
           sound: "room-joined",
-          title: room.roomName,
+          // Fallback to the brand short name if the roomName isn't available.
+          title: room.roomName || MozLoopServiceInternal.localizedStrings.get("clientShortname2"),
           message: MozLoopServiceInternal.localizedStrings.get("rooms_room_joined_label"),
           selectTab: "rooms"
         });
       }
     });
 
     LoopRooms.on("joined", this.maybeResumeTourOnRoomJoined.bind(this));
 
--- a/browser/components/loop/content/shared/js/actions.js
+++ b/browser/components/loop/content/shared/js/actions.js
@@ -368,30 +368,30 @@ loop.shared.actions = (function() {
 
     /**
      * Sets up the room information when it is received.
      * XXX: should move to some roomActions module - refs bug 1079284
      *
      * @see https://wiki.mozilla.org/Loop/Architecture/Rooms#GET_.2Frooms.2F.7Btoken.7D
      */
     SetupRoomInfo: Action.define("setupRoomInfo", {
-      roomName: String,
+      // roomName: String - Optional.
       roomOwner: String,
       roomToken: String,
       roomUrl: String
     }),
 
     /**
      * Updates the room information when it is received.
      * XXX: should move to some roomActions module - refs bug 1079284
      *
      * @see https://wiki.mozilla.org/Loop/Architecture/Rooms#GET_.2Frooms.2F.7Btoken.7D
      */
     UpdateRoomInfo: Action.define("updateRoomInfo", {
-      roomName: String,
+      // roomName: String - Optional.
       roomOwner: String,
       roomUrl: String
     }),
 
     /**
      * Starts the process for the user to join the room.
      * XXX: should move to some roomActions module - refs bug 1079284
      */
--- a/browser/components/loop/content/shared/js/roomStore.js
+++ b/browser/components/loop/content/shared/js/roomStore.js
@@ -32,17 +32,17 @@ loop.store = loop.store || {};
 
   /**
    * Room validation schema. See validate.js.
    * @type {Object}
    */
   var roomSchema = {
     roomToken:    String,
     roomUrl:      String,
-    roomName:     String,
+    // roomName:     String - Optional.
     maxSize:      Number,
     participants: Array,
     ctime:        Number
   };
 
   /**
    * Room type. Basically acts as a typed object constructor.
    *
--- a/browser/components/loop/standalone/content/js/standaloneMozLoop.js
+++ b/browser/components/loop/standalone/content/js/standaloneMozLoop.js
@@ -88,17 +88,16 @@ loop.StandaloneMozLoop = (function(mozL1
           }
         }.bind(this)
       });
 
       req.done(function(responseData) {
         try {
           // We currently only require things we need rather than everything possible.
           callback(null, validate(responseData, {
-            roomName: String,
             roomOwner: String,
             roomUrl: String
           }));
         } catch (err) {
           console.error("Error requesting call info", err.message);
           callback(err);
         }
       }.bind(this));