forked from GitHub/dbot
		
	fix #614
This commit is contained in:
		
							parent
							
								
									93022fa4f2
								
							
						
					
					
						commit
						f2527a6363
					
				| @ -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
 | ||||
|  | ||||
| @ -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); | ||||
| }; | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 reality
						reality