diff --git a/docs/api-v1.md b/docs/api-v1.md index f428b6c3a67..040279ae1bc 100644 --- a/docs/api-v1.md +++ b/docs/api-v1.md @@ -587,6 +587,8 @@ Base endpoint is: `/ocs/v2.php/apps/spreed/api/v1` * `user_removed` - {actor} removed {user} from the conversation * `moderator_promoted` - {actor} promoted {user} to moderator * `moderator_demoted` - {actor} demoted {user} from moderator +* `guest_moderator_promoted` - {actor} promoted {user} to moderator +* `guest_moderator_demoted` - {actor} demoted {user} from moderator ## Guests diff --git a/js/app.js b/js/app.js index 1bf9c440294..e9dd7f24212 100644 --- a/js/app.js +++ b/js/app.js @@ -33,6 +33,7 @@ USER: 3, GUEST: 4, USERSELFJOINED: 5, + GUEST_MODERATOR: 6, /* Must stay in sync with values in "lib/Room.php". */ FLAG_DISCONNECTED: 0, @@ -373,13 +374,15 @@ id: 'participantsTabView' }); - this.signaling.on('participantListChanged', function() { + this._participantsListChangedCallback = function() { // The "participantListChanged" event can be triggered by the // signaling before the room is set in the collection. if (this._participants.url) { this._participants.fetch(); } - }.bind(this)); + }.bind(this); + + this.signaling.on('participantListChanged', this._participantsListChangedCallback); this._participantsView.listenTo(this._rooms, 'change:active', function(model, active) { if (active) { @@ -389,6 +392,15 @@ this._sidebarView.addTab('participants', { label: t('spreed', 'Participants'), icon: 'icon-contacts-dark' }, this._participantsView); }, + _hideParticipantList: function() { + this._sidebarView.removeTab('participants'); + + this.signaling.off('participantListChanged', this._participantsListChangedCallback); + + delete this._participantsListChangedCallback; + delete this._participantsView; + delete this._participants; + }, /** * @param {string} token */ @@ -666,6 +678,18 @@ // in the public share auth page). this.activeRoom = new OCA.SpreedMe.Models.Room({ token: this.token }); this.signaling.setRoom(this.activeRoom); + + this.listenTo(this.activeRoom, 'change:participantType', function(model, participantType) { + if (participantType === OCA.SpreedMe.app.GUEST_MODERATOR) { + this._showParticipantList(); + // The public page supports only a single room, so the + // active room has to be explicitly set as it will not + // be set in a 'change:active' event. + this._participantsView.setRoom(this.activeRoom); + } else { + this._hideParticipantList(); + } + }); } this._registerPageEvents(); diff --git a/js/views/callinfoview.js b/js/views/callinfoview.js index a1d98c28c0f..7d6dcab1747 100644 --- a/js/views/callinfoview.js +++ b/js/views/callinfoview.js @@ -44,8 +44,10 @@ ' ' + '{{#if canModerate}}' + '