Bug 1113739 - Make sure loop.gettingStarted.resumeOnFirstJoin is true before resuming the Hello tour. r=dolske
authorMatthew Noorenberghe <mozilla@noorenberghe.ca>
Fri, 19 Dec 2014 14:07:15 -0500
changeset 220449 0cdeb44ae3d1f240d0100e6c70a6ccf3ed711b36
parent 220448 e770c9dd2500ed57c8d1096434b8693268a82c0b
child 220637 98ee95ac6be5415e3efa14bf41c22e5835d89a3f
push id10502
push usermozilla@noorenberghe.ca
push dateFri, 19 Dec 2014 19:10:48 +0000
treeherderfx-team@0cdeb44ae3d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdolske
bugs1113739
milestone37.0a1
Bug 1113739 - Make sure loop.gettingStarted.resumeOnFirstJoin is true before resuming the Hello tour. r=dolske
browser/components/loop/MozLoopService.jsm
--- a/browser/components/loop/MozLoopService.jsm
+++ b/browser/components/loop/MozLoopService.jsm
@@ -1100,16 +1100,20 @@ this.MozLoopService = {
     });
 
     // Resume the tour (re-opening the tab, if necessary) if someone else joins
     // a room of ours and it's currently open.
     LoopRooms.on("joined", (e, room, participant) => {
       let isOwnerInRoom = false;
       let isOtherInRoom = false;
 
+      if (!this.getLoopPref("gettingStarted.resumeOnFirstJoin")) {
+        return;
+      }
+
       if (!room.participants) {
         return;
       }
 
       // The particpant that joined isn't necessarily included in room.participants (depending on
       // when the broadcast happens) so concatenate.
       for (let participant of room.participants.concat(participant)) {
         if (participant.owner) {
@@ -1519,16 +1523,20 @@ this.MozLoopService = {
       url.searchParams.set("utm_source", "firefox-browser");
       url.searchParams.set("utm_medium", "firefox-browser");
       url.searchParams.set("utm_campaign", aSrc);
     }
     return url;
   },
 
   resumeTour: function(aIncomingConversationState) {
+    if (!this.getLoopPref("gettingStarted.resumeOnFirstJoin")) {
+      return;
+    }
+
     let url = this.getTourURL("resume-with-conversation", {
       incomingConversation: aIncomingConversationState,
     });
 
     let win = Services.wm.getMostRecentWindow("navigator:browser");
 
     this.setLoopPref("gettingStarted.resumeOnFirstJoin", false);