Bug 1198841 - Brief message to invite someone to join when joining a room with someone already there [r=Standard8]

This commit is contained in:
Ed Lee
2015-08-28 01:39:59 -07:00
parent 2384510b0d
commit bdecec775f
5 changed files with 113 additions and 4 deletions

View File

@@ -593,8 +593,20 @@ loop.roomViews = (function(mozL10n) {
}));
},
/**
* Determine if the invitation controls should be shown.
*
* @return {Boolean} True if there's no guests.
*/
_shouldRenderInvitationOverlay: function() {
return (this.state.roomState !== ROOM_STATES.HAS_PARTICIPANTS);
var hasGuests = typeof this.state.participants === "object" &&
this.state.participants.filter(function(participant) {
return !participant.owner;
}).length > 0;
// Don't show if the room has participants whether from the room state or
// there being non-owner guests in the participants array.
return this.state.roomState !== ROOM_STATES.HAS_PARTICIPANTS && !hasGuests;
},
/**