Rearrange ranks a bit and fix unleader bug
This commit is contained in:
parent
b2b134ce4a
commit
91b8a6cab6
|
@ -477,7 +477,8 @@ Channel.prototype.changeLeader = function(name) {
|
|||
this.broadcastRankUpdate(old);
|
||||
}
|
||||
if(name == "") {
|
||||
channelVideoUpdate(this, this.currentMedia.id);
|
||||
if(this.currentMedia != null)
|
||||
channelVideoUpdate(this, this.currentMedia.id);
|
||||
return;
|
||||
}
|
||||
for(var i = 0; i < this.users.length; i++) {
|
||||
|
|
5
rank.js
5
rank.js
|
@ -8,14 +8,15 @@
|
|||
|
||||
exports.Guest = 0;
|
||||
exports.Member = 1;
|
||||
exports.Moderator = 4;
|
||||
exports.Owner = 8;
|
||||
exports.Moderator = 2;
|
||||
exports.Owner = 3;
|
||||
exports.Siteadmin = 255;
|
||||
|
||||
var permissions = {
|
||||
queue: exports.Moderator,
|
||||
assignLeader: exports.Moderator,
|
||||
kick: exports.Moderator,
|
||||
promote: exports.Moderator,
|
||||
search: exports.Guest,
|
||||
chat: exports.Guest,
|
||||
};
|
||||
|
|
12
user.js
12
user.js
|
@ -63,14 +63,18 @@ User.prototype.initCallbacks = function() {
|
|||
}.bind(this));
|
||||
|
||||
this.socket.on('promote', function(data) {
|
||||
if(this.channel != null) {
|
||||
this.channel.promoteUser(this, data.name);
|
||||
if(Rank.hasPermission(this, "promote")) {
|
||||
if(this.channel != null) {
|
||||
this.channel.promoteUser(this, data.name);
|
||||
}
|
||||
}
|
||||
}.bind(this));
|
||||
|
||||
this.socket.on('demote', function(data) {
|
||||
if(this.channel != null) {
|
||||
this.channel.demoteUser(this, data.name);
|
||||
if(Rank.hasPermission(this, "promote")) {
|
||||
if(this.channel != null) {
|
||||
this.channel.demoteUser(this, data.name);
|
||||
}
|
||||
}
|
||||
}.bind(this));
|
||||
|
||||
|
|
|
@ -150,7 +150,7 @@ function initCallbacks() {
|
|||
PLAYER.api('getCurrentTime', function(data) {
|
||||
socket.emit('mediaUpdate', {
|
||||
id: PLAYER.videoid,
|
||||
seconds: data.seconds,
|
||||
seconds: data,
|
||||
paused: false,
|
||||
type: "vi"
|
||||
});
|
||||
|
|
|
@ -19,8 +19,8 @@ var pw = readCookie('sync_pw');
|
|||
var Rank = {
|
||||
Guest: 0,
|
||||
Member: 1,
|
||||
Moderator: 4,
|
||||
Owner: 8,
|
||||
Moderator: 2,
|
||||
Owner: 3,
|
||||
Siteadmin: 255
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue