Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2017-09-19 16:37:08 +02:00
Родитель d320966802
Коммит 960214ff3d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: E166FD8976B3BAC8
1 изменённых файлов: 9 добавлений и 9 удалений

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

@ -101,17 +101,17 @@
}); });
}, },
templateContext: function() { templateContext: function() {
var canModerate = this.model.get('participantType') !== 1 && // can not moderate owners var canModerate = this.model.get('participantType') !== OCA.SpreedMe.app.OWNER && // can not moderate owners
this.model.get('userId') !== oc_current_user && // can not moderate yourself this.model.get('userId') !== oc_current_user && // can not moderate yourself
(OCA.SpreedMe.app.activeRoom.get('participantType') === 1 || // current user must be owner (OCA.SpreedMe.app.activeRoom.get('participantType') === OCA.SpreedMe.app.OWNER || // current user must be owner
OCA.SpreedMe.app.activeRoom.get('participantType') === 2); // or moderator. OCA.SpreedMe.app.activeRoom.get('participantType') === OCA.SpreedMe.app.MODERATOR); // or moderator.
return { return {
canModerate: canModerate, canModerate: canModerate,
name: this.model.get('userId').length ? this.model.get('displayName') : t('spreed', 'Guest'), name: this.model.get('userId').length ? this.model.get('displayName') : t('spreed', 'Guest'),
participantIsUser: this.model.get('participantType') === 3, participantIsUser: this.model.get('participantType') === OCA.SpreedMe.app.USER,
participantIsModerator: this.model.get('participantType') === 2, participantIsModerator: this.model.get('participantType') === OCA.SpreedMe.app.MODERATOR,
participantIsOwner: this.model.get('participantType') === 1 participantIsOwner: this.model.get('participantType') === OCA.SpreedMe.app.OWNER
}; };
}, },
onRender: function() { onRender: function() {
@ -155,7 +155,7 @@
this.ui.menu.toggleClass('open', this.menuShown); this.ui.menu.toggleClass('open', this.menuShown);
}, },
promoteToModerator: function() { promoteToModerator: function() {
if (this.model.get('participantType') !== 3) { if (this.model.get('participantType') !== OCA.SpreedMe.app.USER) {
return; return;
} }
@ -177,7 +177,7 @@
}); });
}, },
demoteFromModerator: function() { demoteFromModerator: function() {
if (this.model.get('participantType') !== 2) { if (this.model.get('participantType') !== OCA.SpreedMe.app.MODERATOR) {
return; return;
} }
@ -199,7 +199,7 @@
}); });
}, },
removeParticipant: function() { removeParticipant: function() {
if (this.model.get('participantType') === 1) { if (this.model.get('participantType') === OCA.SpreedMe.app.OWNER) {
return; return;
} }