Browse Source

Display the participant panel for guests

Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/1078/head
Joas Schilling 7 years ago
committed by Daniel Calviño Sánchez
parent
commit
016dfd9d72
  1. 27
      js/app.js
  2. 4
      templates/index-public.php

27
js/app.js

@ -374,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) {
@ -390,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
*/
@ -667,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();

4
templates/index-public.php

@ -22,9 +22,13 @@ script(
'models/localstoragemodel',
'models/room',
'models/roomcollection',
'models/participant',
'models/participantcollection',
'views/callinfoview',
'views/chatview',
'views/editabletextlabel',
'views/participantlistview',
'views/participantview',
'views/roomlistview',
'views/sidebarview',
'views/tabview',

Loading…
Cancel
Save