Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2019-04-11 12:14:01 +0300
committerGitHub <noreply@github.com>2019-04-11 12:14:01 +0300
commitcc8c692f9f0908025f6bb548ebb5408b5f61e973 (patch)
tree0494863904e9d2aa22d4c3e765cf33601e001623
parentd6d8a847c79ee1d1e600a338f1ed3d356cd07d2e (diff)
parent3a8503ec2f3e5f4ed141b254a5a4fc85d8d400a7 (diff)
Merge pull request #1705 from nextcloud/backport/1704/stable15
[stable15] Fix participant actions not updated on current participant type changes
-rw-r--r--js/views/participantlistview.js23
1 files changed, 16 insertions, 7 deletions
diff --git a/js/views/participantlistview.js b/js/views/participantlistview.js
index 353ced662..c9915fbef 100644
--- a/js/views/participantlistview.js
+++ b/js/views/participantlistview.js
@@ -99,6 +99,15 @@
},
},
initialize: function() {
+ this.room = this.model.collection.room;
+
+ // When the type of the current participant changes the
+ // available actions on the participant shown by this item view
+ // change too, so the view should be rendered again.
+ this.listenTo(this.room, 'change:participantType', function() {
+ this.render();
+ });
+
this.listenTo(uiChannel, 'document:click', function(event) {
var target = $(event.target);
if (!target.closest('.popovermenu').is(this.ui.menu) && !target.is(this.ui.menuButton)) {
@@ -113,11 +122,11 @@
isModerator = false;
if (OC.getCurrentUser().uid) {
isSelf = this.model.get('userId') === OC.getCurrentUser().uid;
- isModerator = OCA.SpreedMe.app.activeRoom.get('participantType') === OCA.SpreedMe.app.OWNER ||
- OCA.SpreedMe.app.activeRoom.get('participantType') === OCA.SpreedMe.app.MODERATOR;
+ isModerator = this.room.get('participantType') === OCA.SpreedMe.app.OWNER ||
+ this.room.get('participantType') === OCA.SpreedMe.app.MODERATOR;
} else {
- isSelf = this.model.get('sessionId') === OCA.SpreedMe.app.activeRoom.get('sessionId');
- isModerator = OCA.SpreedMe.app.activeRoom.get('participantType') === OCA.SpreedMe.app.GUEST_MODERATOR;
+ isSelf = this.model.get('sessionId') === this.room.get('sessionId');
+ isModerator = this.room.get('participantType') === OCA.SpreedMe.app.GUEST_MODERATOR;
}
var canModerate = this.model.get('participantType') !== OCA.SpreedMe.app.OWNER && // can not moderate owners
@@ -221,7 +230,7 @@
$.ajax({
type: 'POST',
- url: OC.linkToOCS('apps/spreed/api/v1/room', 2) + OCA.SpreedMe.app.activeRoom.get('token') + '/moderators',
+ url: OC.linkToOCS('apps/spreed/api/v1/room', 2) + this.room.get('token') + '/moderators',
data: data,
success: function() {
if (self.model.get('userId')) {
@@ -267,7 +276,7 @@
$.ajax({
type: 'DELETE',
- url: OC.linkToOCS('apps/spreed/api/v1/room', 2) + OCA.SpreedMe.app.activeRoom.get('token') + '/moderators',
+ url: OC.linkToOCS('apps/spreed/api/v1/room', 2) + this.room.get('token') + '/moderators',
data:data,
success: function() {
if (self.model.get('userId')) {
@@ -309,7 +318,7 @@
$.ajax({
type: 'DELETE',
- url: OC.linkToOCS('apps/spreed/api/v1/room', 2) + OCA.SpreedMe.app.activeRoom.get('token') + endpoint,
+ url: OC.linkToOCS('apps/spreed/api/v1/room', 2) + this.room.get('token') + endpoint,
data: {
participant: participantId
},