3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-28 05:32:50 +01:00
This commit is contained in:
reality 2014-02-26 23:24:56 +00:00
parent 93022fa4f2
commit f2527a6363
2 changed files with 11 additions and 10 deletions

View File

@ -120,7 +120,6 @@ var commands = function(dbot) {
dbot.api.nickserv.getUserHost(event.server, banee, function(host) {
// Add host record entry
if(host) {
if(!_.has(this.hosts, event.server)) this.hosts[event.server] = {};
this.hosts[event.server][banee] = host;
// Create notify string

View File

@ -1,14 +1,6 @@
var _ = require('underscore')._;
var kick = function(dbot) {
if(!_.has(dbot.db, 'hosts')) dbot.db.hosts = {};
if(!_.has(dbot.db, 'tempBans')) dbot.db.tempBans = {};
this.hosts = dbot.db.hosts;
this.tempBans = dbot.db.tempBans;
_.each(dbot.config.servers, function(v, k) {
this.hosts[k] = {};
}, this);
var kick = function(dbot) {
this.api = {
'ban': function(server, host, channel) {
dbot.instance.connections[server].send('MODE ' + channel + ' +b *!*@' + host);
@ -137,6 +129,16 @@ var kick = function(dbot) {
if(_.has(dbot.modules, 'web')) {
dbot.api.web.addIndexLink('/bans', 'Ban List');
}
if(!_.has(dbot.db, 'hosts')) {
dbot.db.hosts = {};
_.each(dbot.config.servers, function(v, k) {
dbot.db.hosts[k] = {};
}, this);
}
if(!_.has(dbot.db, 'tempBans')) dbot.db.tempBans = {};
this.hosts = dbot.db.hosts;
this.tempBans = dbot.db.tempBans;
}.bind(this);
};