diff --git a/channel.js b/channel.js index a2c6fe16..9aeb9d4a 100644 --- a/channel.js +++ b/channel.js @@ -367,8 +367,11 @@ Channel.prototype.tryNameBan = function(actor, name) { break; } } - //this.broadcastBanlist(); this.logger.log(name + " was banned by " + actor.name); + var chan = this; + this.users.forEach(function(u) { + chan.sendBanlist(u); + }); if(!this.registered) { return false; } @@ -383,9 +386,12 @@ Channel.prototype.unbanName = function(actor, name) { this.namebans[name] = null; delete this.namebans[name]; - //this.broadcastBanlist(); this.logger.log(name + " was unbanned by " + actor.name); + var chan = this; + this.users.forEach(function(u) { + chan.sendBanlist(u); + }); return Database.channelUnbanName(this.name, name); } @@ -430,6 +436,11 @@ Channel.prototype.tryIPBan = function(actor, name, range) { // Update database ban table return Database.channelBan(chan.name, ip, name, actor.name); }); + + var chan = this; + this.users.forEach(function(u) { + chan.sendBanlist(u); + }); } Channel.prototype.banIP = function(actor, receiver) { @@ -458,6 +469,10 @@ Channel.prototype.unbanIP = function(actor, ip) { return false; this.ipbans[ip] = null; + var chan = this; + this.users.forEach(function(u) { + chan.sendBanlist(u); + }); if(!this.registered) return false; @@ -681,15 +696,12 @@ Channel.prototype.sendRankStuff = function(user) { } user.socket.emit("chatFilters", {filters: filts}); } - this.sendACL(user); + this.sendChannelRanks(user); } -Channel.prototype.sendSeenLogins = function(user) { -} - -Channel.prototype.sendACL = function(user) { +Channel.prototype.sendChannelRanks = function(user) { if(Rank.hasPermission(user, "acl")) { - user.socket.emit("acl", Database.listChannelRanks(this.name)); + user.socket.emit("channelRanks", Database.listChannelRanks(this.name)); } } @@ -805,7 +817,7 @@ Channel.prototype.broadcastNewUser = function(user) { }; this.users.forEach(function(u) { if(u.rank >= 2) { - u.socket.emit("chatMsg", pkt); + u.socket.emit("joinMessage", pkt); } }); } diff --git a/user.js b/user.js index 3eeda81c..ca03bb32 100644 --- a/user.js +++ b/user.js @@ -391,10 +391,11 @@ User.prototype.initCallbacks = function() { } }.bind(this)); - this.socket.on("requestAcl", function() { + this.socket.on("requestChannelRanks", function() { if(this.channel != null) { - this.channel.sendACL(this); - this.noflood("requestAcl", 0.25); + if(this.noflood("requestChannelRanks", 0.25)) + return; + this.channel.sendChannelRanks(this); } }.bind(this)); diff --git a/www/assets/js/callbacks.js b/www/assets/js/callbacks.js index aeec406e..ff3c7311 100644 --- a/www/assets/js/callbacks.js +++ b/www/assets/js/callbacks.js @@ -308,21 +308,27 @@ Callbacks = { }, channelRanks: function(entries) { - // TODO Edit if necessary + var tbl = $("#channelranks table"); + // Dammit jQuery UI + if(!tbl.hasClass("table")) { + setTimeout(function() { + Callbacks.channelRanks(entries); + }, 100); + return; + } entries.sort(function(a, b) { var x = a.name.toLowerCase(); var y = b.name.toLowerCase(); return y == x ? 0 : (x < y ? -1 : 1); }); $("#channelranks").data("entries", entries); - var tbl = $("#channelranks table"); if(tbl.children().length > 1) { $(tbl.children()[1]).remove(); } - $("#acl_pagination").remove(); + $("#channelranks_pagination").remove(); if(entries.length > 20) { var pag = $("
").addClass("pagination span12") - .attr("id", "acl_pagination") + .attr("id", "channelranks_pagination") .prependTo($("#channelranks")); var btns = $("
@@ -126,3 +127,13 @@ Filters Here +
+ + + + + + + +
NameRank (click to edit)
+