From c9b5254f24f55e7e3131a6d45b5965dfb3bf4f8d Mon Sep 17 00:00:00 2001 From: calzoneman Date: Sun, 18 Aug 2013 13:35:57 -0500 Subject: [PATCH] Fix rank change for person in channel --- channel.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/channel.js b/channel.js index bd1b2924..0b476c65 100644 --- a/channel.js +++ b/channel.js @@ -456,10 +456,10 @@ Channel.prototype.getRank = function (name, callback) { }); } -Channel.prototype.saveRank = function (user) { +Channel.prototype.saveRank = function (user, callback) { if(!this.registered) return; - this.server.db.setChannelRank(this.name, user.name, user.rank); + this.server.db.setChannelRank(this.name, user.name, user.rank, callback); } Channel.prototype.getIPRank = function (ip, callback) { @@ -1982,7 +1982,11 @@ Channel.prototype.trySetRank = function(user, data) { return; receiver.rank = data.rank; if(receiver.loggedIn) { - self.saveRank(receiver); + self.saveRank(receiver, function (err, res) { + self.logger.log("*** " + user.name + " set " + + data.user + "'s rank to " + data.rank); + self.sendAllWithPermission("acl", "setChannelRank", data); + }); } self.broadcastUserUpdate(receiver); } else if(self.registered) {