This commit is contained in:
calzoneman 2013-11-15 10:24:43 -06:00
parent 22e8e10680
commit 681911ffb1
2 changed files with 10 additions and 3 deletions

View File

@ -2370,7 +2370,7 @@ Channel.prototype.changeLeader = function(name) {
old.rank = old.oldrank; old.rank = old.oldrank;
} }
this.sendAll("setUserRank", { this.sendAll("setUserRank", {
name: name, name: old.name,
rank: old.rank rank: old.rank
}); });
} }

View File

@ -533,7 +533,7 @@ Callbacks = {
setChannelRank: function(data) { setChannelRank: function(data) {
var ents = $("#channelranks").data("entries"); var ents = $("#channelranks").data("entries");
if(typeof ents === "undefined") if(typeof ents === "undefined" || ents === null)
return; return;
for(var i = 0; i < ents.length; i++) { for(var i = 0; i < ents.length; i++) {
if(ents[i].name == data.user) { if(ents[i].name == data.user) {
@ -724,8 +724,10 @@ Callbacks = {
if(LEADTMR) if(LEADTMR)
clearInterval(LEADTMR); clearInterval(LEADTMR);
LEADTMR = setInterval(sendVideoUpdate, 5000); LEADTMR = setInterval(sendVideoUpdate, 5000);
} else { handlePermissionChange();
} else if (CLIENT.leader) {
CLIENT.leader = false; CLIENT.leader = false;
handlePermissionChange();
if(LEADTMR) if(LEADTMR)
clearInterval(LEADTMR); clearInterval(LEADTMR);
LEADTMR = false; LEADTMR = false;
@ -739,6 +741,10 @@ Callbacks = {
} }
user.data("rank", data.rank); user.data("rank", data.rank);
if (data.name === CLIENT.name) {
CLIENT.rank = data.rank;
handlePermissionChange();
}
formatUserlistItem(user); formatUserlistItem(user);
addUserDropdown(user); addUserDropdown(user);
if(USEROPTS.sort_rank) if(USEROPTS.sort_rank)
@ -761,6 +767,7 @@ Callbacks = {
- setAFK - setAFK
- setLeader - setLeader
- setUserProfile - setUserProfile
- setUserRank
*/ */
updateUser: function(data) { updateUser: function(data) {
if(data.name == CLIENT.name) { if(data.name == CLIENT.name) {