Bug 1157646 - Stop passing the roomOwner parameter around everywhere in Loop's rooms. r=mikedeboer

This commit is contained in:
Mark Banner 2015-08-27 12:10:47 +01:00
Родитель 197c1b99e8
Коммит 0f48524bec
10 изменённых файлов: 4 добавлений и 41 удалений

Просмотреть файл

@ -462,7 +462,6 @@ loop.shared.actions = (function() {
// roomContextUrls: Array - Optional.
// roomDescription: String - Optional.
// roomName: String - Optional.
roomOwner: String,
roomToken: String,
roomUrl: String,
socialShareProviders: Array
@ -477,7 +476,6 @@ loop.shared.actions = (function() {
UpdateRoomInfo: Action.define("updateRoomInfo", {
// description: String - Optional.
// roomName: String - Optional.
roomOwner: String,
roomUrl: String
// urls: Array - Optional.
// See https://wiki.mozilla.org/Loop/Architecture/Context#Format_of_context.value

Просмотреть файл

@ -273,7 +273,6 @@ loop.store.ActiveRoomStore = (function() {
roomContextUrls: roomData.decryptedContext.urls,
roomDescription: roomData.decryptedContext.description,
roomName: roomData.decryptedContext.roomName,
roomOwner: roomData.roomOwner,
roomUrl: roomData.roomUrl,
socialShareProviders: this._mozLoop.getSocialShareProviders()
}));
@ -325,7 +324,6 @@ loop.store.ActiveRoomStore = (function() {
}
var roomInfoData = new sharedActions.UpdateRoomInfo({
roomOwner: result.roomOwner,
roomUrl: result.roomUrl
});
@ -396,7 +394,6 @@ loop.store.ActiveRoomStore = (function() {
roomContextUrls: actionData.roomContextUrls,
roomDescription: actionData.roomDescription,
roomName: actionData.roomName,
roomOwner: actionData.roomOwner,
roomState: ROOM_STATES.READY,
roomToken: actionData.roomToken,
roomUrl: actionData.roomUrl,
@ -420,7 +417,6 @@ loop.store.ActiveRoomStore = (function() {
*/
updateRoomInfo: function(actionData) {
var newState = {
roomOwner: actionData.roomOwner,
roomUrl: actionData.roomUrl
};
// Iterate over the optional fields that _may_ be present on the actionData
@ -456,7 +452,6 @@ loop.store.ActiveRoomStore = (function() {
urls: roomData.decryptedContext.urls,
description: roomData.decryptedContext.description,
roomName: roomData.decryptedContext.roomName,
roomOwner: roomData.roomOwner,
roomUrl: roomData.roomUrl
}));
},

Просмотреть файл

@ -91,7 +91,6 @@ loop.StandaloneMozLoop = (function(mozL10n) {
try {
// We currently only require things we need rather than everything possible.
callback(null, validate(responseData, {
roomOwner: String,
roomUrl: String
}));
} catch (err) {

Просмотреть файл

@ -310,7 +310,6 @@ describe("loop.store.ActiveRoomStore", function () {
decryptedContext: {
roomName: "Monkeys"
},
roomOwner: "Alfred",
roomUrl: "http://invalid"
};
@ -353,7 +352,6 @@ describe("loop.store.ActiveRoomStore", function () {
roomDescription: undefined,
roomToken: fakeToken,
roomName: fakeRoomData.decryptedContext.roomName,
roomOwner: fakeRoomData.roomOwner,
roomUrl: fakeRoomData.roomUrl,
socialShareProviders: []
}));
@ -426,7 +424,6 @@ describe("loop.store.ActiveRoomStore", function () {
it("should dispatch an UpdateRoomInfo message with 'no data' failure if neither roomName nor context are supplied", function() {
fakeMozLoop.rooms.get.callsArgWith(1, null, {
roomOwner: "Dan",
roomUrl: "http://invalid"
});
@ -436,7 +433,6 @@ describe("loop.store.ActiveRoomStore", function () {
sinon.assert.calledWithExactly(dispatcher.dispatch,
new sharedActions.UpdateRoomInfo({
roomInfoFailure: ROOM_INFO_FAILURES.NO_DATA,
roomOwner: "Dan",
roomState: ROOM_STATES.READY,
roomUrl: "http://invalid"
}));
@ -446,8 +442,7 @@ describe("loop.store.ActiveRoomStore", function () {
it("should dispatch UpdateRoomInfo if mozLoop.rooms.get is successful", function() {
var roomDetails = {
roomName: "fakeName",
roomUrl: "http://invalid",
roomOwner: "gavin"
roomUrl: "http://invalid"
};
fakeMozLoop.rooms.get.callsArgWith(1, null, roomDetails);
@ -470,12 +465,10 @@ describe("loop.store.ActiveRoomStore", function () {
context: {
value: "fakeContext"
},
roomUrl: "http://invalid",
roomOwner: "Mark"
roomUrl: "http://invalid"
};
expectedDetails = {
roomUrl: "http://invalid",
roomOwner: "Mark"
roomUrl: "http://invalid"
};
fakeMozLoop.rooms.get.callsArgWith(1, null, roomDetails);
@ -597,7 +590,6 @@ describe("loop.store.ActiveRoomStore", function () {
beforeEach(function() {
fakeRoomInfo = {
roomName: "Its a room",
roomOwner: "Me",
roomToken: "fakeToken",
roomUrl: "http://invalid",
socialShareProviders: []
@ -615,7 +607,6 @@ describe("loop.store.ActiveRoomStore", function () {
var state = store.getStoreState();
expect(state.roomName).eql(fakeRoomInfo.roomName);
expect(state.roomOwner).eql(fakeRoomInfo.roomOwner);
expect(state.roomToken).eql(fakeRoomInfo.roomToken);
expect(state.roomUrl).eql(fakeRoomInfo.roomUrl);
expect(state.socialShareProviders).eql([]);
@ -628,7 +619,6 @@ describe("loop.store.ActiveRoomStore", function () {
beforeEach(function() {
fakeRoomInfo = {
roomName: "Its a room",
roomOwner: "Me",
roomUrl: "http://invalid",
urls: [{
description: "fake site",
@ -643,7 +633,6 @@ describe("loop.store.ActiveRoomStore", function () {
var state = store.getStoreState();
expect(state.roomName).eql(fakeRoomInfo.roomName);
expect(state.roomOwner).eql(fakeRoomInfo.roomOwner);
expect(state.roomUrl).eql(fakeRoomInfo.roomUrl);
expect(state.roomContextUrls).eql(fakeRoomInfo.urls);
});
@ -1503,7 +1492,6 @@ describe("loop.store.ActiveRoomStore", function () {
beforeEach(function() {
store.setupRoomInfo(new sharedActions.SetupRoomInfo({
roomName: "Its a room",
roomOwner: "Me",
roomToken: "fakeToken",
roomUrl: "http://invalid",
socialShareProviders: []
@ -1521,7 +1509,6 @@ describe("loop.store.ActiveRoomStore", function () {
fake: "url"
}
},
roomOwner: "you",
roomUrl: "original"
};
@ -1532,7 +1519,6 @@ describe("loop.store.ActiveRoomStore", function () {
new sharedActions.UpdateRoomInfo({
description: "fakeDescription",
roomName: fakeRoomData.decryptedContext.roomName,
roomOwner: fakeRoomData.roomOwner,
roomUrl: fakeRoomData.roomUrl,
urls: {
fake: "url"
@ -1549,7 +1535,6 @@ describe("loop.store.ActiveRoomStore", function () {
fake: "url"
}
},
roomOwner: "you",
roomUrl: "original"
};
@ -1564,7 +1549,6 @@ describe("loop.store.ActiveRoomStore", function () {
decryptedContext: {
roomName: "Its a room"
},
roomOwner: "Me",
roomToken: "fakeToken",
roomUrl: "http://invalid"
};

Просмотреть файл

@ -156,7 +156,6 @@ describe("loop.store.TextChatStore", function () {
it("should add the room name to the list", function() {
store.updateRoomInfo(new sharedActions.UpdateRoomInfo({
roomName: "Let's share!",
roomOwner: "Mark",
roomUrl: "fake"
}));
@ -173,7 +172,6 @@ describe("loop.store.TextChatStore", function () {
it("should add the context to the list", function() {
store.updateRoomInfo(new sharedActions.UpdateRoomInfo({
roomName: "Let's share!",
roomOwner: "Mark",
roomUrl: "fake",
urls: [{
description: "A wonderful event",
@ -206,7 +204,6 @@ describe("loop.store.TextChatStore", function () {
it("should not add more than one context message", function() {
store.updateRoomInfo(new sharedActions.UpdateRoomInfo({
roomOwner: "Mark",
roomUrl: "fake",
urls: [{
description: "A wonderful event",
@ -228,7 +225,6 @@ describe("loop.store.TextChatStore", function () {
}]);
store.updateRoomInfo(new sharedActions.UpdateRoomInfo({
roomOwner: "Mark",
roomUrl: "fake",
urls: [{
description: "A wonderful event2",
@ -253,7 +249,6 @@ describe("loop.store.TextChatStore", function () {
it("should not dispatch a LoopChatMessageAppended event", function() {
store.updateRoomInfo(new sharedActions.UpdateRoomInfo({
roomName: "Let's share!",
roomOwner: "Mark",
roomUrl: "fake"
}));

Просмотреть файл

@ -540,7 +540,6 @@ describe("loop.shared.views.TextChatView", function () {
store.updateRoomInfo(new sharedActions.UpdateRoomInfo({
roomName: "A wonderful surprise!",
roomOwner: "Chris",
roomUrl: "Fake"
}));
@ -558,7 +557,6 @@ describe("loop.shared.views.TextChatView", function () {
store.updateRoomInfo(new sharedActions.UpdateRoomInfo({
roomName: "A Very Long Conversation Name",
roomOwner: "fake",
roomUrl: "http://showcase",
urls: [{
description: "A wonderful page!",

Просмотреть файл

@ -83,8 +83,7 @@ describe("loop.StandaloneMozLoop", function() {
var roomDetails = {
roomName: "fakeName",
roomUrl: "http://invalid",
roomOwner: "gavin"
roomUrl: "http://invalid"
};
requests[0].respond(200, {"Content-Type": "application/json"},

Просмотреть файл

@ -15,7 +15,6 @@ var fakeRooms = [
}]
},
"roomUrl": "http://localhost:3000/rooms/_nxD4V4FflQ",
"roomOwner": "Alexis",
"maxSize": 2,
"creationTime": 1405517546,
"ctime": 1405517546,
@ -28,7 +27,6 @@ var fakeRooms = [
"roomName": "Second Room Name"
},
"roomUrl": "http://localhost:3000/rooms/QzBbvGmIZWU",
"roomOwner": "Alexis",
"maxSize": 2,
"creationTime": 1405517546,
"ctime": 1405517546,
@ -41,7 +39,6 @@ var fakeRooms = [
"roomName": "UX Discussion"
},
"roomUrl": "http://localhost:3000/rooms/3jKS_Els9IU",
"roomOwner": "Alexis",
"maxSize": 2,
"clientMaxSize": 2,
"creationTime": 1405517546,

Просмотреть файл

@ -385,7 +385,6 @@
// Update the text chat store with the room info.
textChatStore.updateRoomInfo(new sharedActions.UpdateRoomInfo({
roomName: "A Very Long Conversation Name",
roomOwner: "fake",
roomUrl: "http://showcase",
urls: [{
description: "A wonderful page!",

Просмотреть файл

@ -385,7 +385,6 @@
// Update the text chat store with the room info.
textChatStore.updateRoomInfo(new sharedActions.UpdateRoomInfo({
roomName: "A Very Long Conversation Name",
roomOwner: "fake",
roomUrl: "http://showcase",
urls: [{
description: "A wonderful page!",