Fix #291
This commit is contained in:
parent
718a70bc60
commit
f5cbdb2f24
|
@ -1,3 +1,7 @@
|
|||
Mon Oct 07 10:02 2013 CDT
|
||||
* lib/channel.js: Fix several cases where an unregistered channel
|
||||
might attempt to make a database call which then fails.
|
||||
|
||||
Mon Oct 07 00:08 2013 CDT
|
||||
* lib/playlist.js: Fix /clean not behaving properly (actually was a
|
||||
consequence of the remove() function)
|
||||
|
|
|
@ -509,11 +509,7 @@ Channel.prototype.getIPRank = function (ip, callback) {
|
|||
self.server.db.listAliases(ip, function (err, names) {
|
||||
if (self.dead)
|
||||
return;
|
||||
self.server.db.listChannelUserRanks(self.name, names,
|
||||
function (err, res) {
|
||||
if (self.dead)
|
||||
return;
|
||||
|
||||
self.server.db.listGlobalRanks(names, function (err, res) {
|
||||
if(err) {
|
||||
callback(err, null);
|
||||
return;
|
||||
|
@ -524,7 +520,16 @@ Channel.prototype.getIPRank = function (ip, callback) {
|
|||
rank = (res[i] > rank) ? res[i] : rank;
|
||||
}
|
||||
|
||||
self.server.db.listGlobalRanks(names, function (err, res) {
|
||||
if (!self.registered) {
|
||||
callback(null, rank);
|
||||
return;
|
||||
}
|
||||
|
||||
self.server.db.listChannelUserRanks(self.name, names,
|
||||
function (err, res) {
|
||||
if (self.dead)
|
||||
return;
|
||||
|
||||
if(err) {
|
||||
callback(err, null);
|
||||
return;
|
||||
|
@ -536,6 +541,7 @@ Channel.prototype.getIPRank = function (ip, callback) {
|
|||
|
||||
callback(null, rank);
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -621,6 +627,8 @@ Channel.prototype.unbanName = function(actor, name) {
|
|||
self.namebans[name] = null;
|
||||
delete self.namebans[name];
|
||||
self.logger.log("*** " + actor.name + " un-namebanned " + name);
|
||||
if (!self.registered)
|
||||
return;
|
||||
|
||||
self.server.db.clearChannelNameBan(self.name, name, function (err, res) {
|
||||
if (self.dead)
|
||||
|
@ -1673,6 +1681,8 @@ Channel.prototype.tryUncache = function(user, data) {
|
|||
if(typeof data.id != "string") {
|
||||
return;
|
||||
}
|
||||
if (!self.registered)
|
||||
return;
|
||||
self.server.db.removeFromLibrary(self.name, data.id,
|
||||
function (err, res) {
|
||||
if (self.dead)
|
||||
|
|
Loading…
Reference in a new issue