Bug 1113739 - Make sure loop.gettingStarted.resumeOnFirstJoin is true before resuming the Hello tour. r=dolske a=dolske
authorMatthew Noorenberghe <mozilla@noorenberghe.ca>
Fri, 19 Dec 2014 14:07:15 -0500
changeset 234432 064cdb43232b5366df464aacafb6ea9b5c136cea
parent 234431 be7097c9f0609f168194c6bba7cc2d58b79cd8c3
child 234433 7b5b9a7b842ab1b68a55393fb355ab86c3648d5c
push id7386
push userrjesup@wgate.com
push dateFri, 19 Dec 2014 21:44:54 +0000
treeherdermozilla-aurora@064cdb43232b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdolske, dolske
bugs1113739
milestone36.0a2
Bug 1113739 - Make sure loop.gettingStarted.resumeOnFirstJoin is true before resuming the Hello tour. r=dolske a=dolske
browser/components/loop/MozLoopService.jsm
--- a/browser/components/loop/MozLoopService.jsm
+++ b/browser/components/loop/MozLoopService.jsm
@@ -1099,16 +1099,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) {
@@ -1518,16 +1522,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);