Rearrange ranks a bit and fix unleader bug

This commit is contained in:
calzoneman 2013-03-05 17:06:25 -06:00
parent b2b134ce4a
commit 91b8a6cab6
5 changed files with 16 additions and 10 deletions

View file

@ -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++) {

View file

@ -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
View file

@ -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));

View file

@ -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"
});

View file

@ -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
};