Skip to content
Snippets Groups Projects
Commit c54c8739 authored by deuce's avatar deuce
Browse files

Remove stupid "Type '!HELP' for a list of commands." thinger.

parent c9d1c325
No related branches found
No related tags found
No related merge requests found
...@@ -14,47 +14,28 @@ function get_geoip(host, countryonly) ...@@ -14,47 +14,28 @@ function get_geoip(host, countryonly)
{ {
var GeoIP; var GeoIP;
var m,i,j; var m,i,j;
var ishost=false;
var geoip_url; var geoip_url;
var result; var result;
var tmpobj={}; var tmpobj={};
var isarray=(typeof(host)=='object' && host instanceof Array); var isarray=(typeof(host)=='object' && host instanceof Array);
/* if(isarray) {
* Check if this is an IP address or a hostname... for(i in host)
* (We'll ignore weird encodings though like 12345.12345) host[i]=resolve_ip(host[i]);
*/
if(!isarray) {
m=host.match(/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/);
if(m!=null) {
if(m.length==5) {
for(i=1; i<5; i++) {
j=parseInt(m[i]);
if(j < 0 || j > 255) {
ishost=true;
break;
}
}
}
} }
else else
ishost=true; host=resolve_ip(host);
}
// Get the best URL // Get the best URL
if(countryonly) { if(countryonly) {
if(isarray) if(isarray)
geoip_url='http://api.ipinfodb.com/v3/ip-country/?key='+geoipAPIKey+'&format=json&ip='+encodeURIComponent(host.join(',')); geoip_url='http://api.ipinfodb.com/v3/ip-country/?key='+geoipAPIKey+'&format=json&ip='+encodeURIComponent(host.join(','));
else if(ishost)
geoip_url='http://api.ipinfodb.com/v3/ip-country/?key='+geoipAPIKey+'&format=json&ip='+encodeURIComponent(host);
else else
geoip_url='http://api.ipinfodb.com/v3/ip-country/?key='+geoipAPIKey+'&format=json&ip='+encodeURIComponent(host); geoip_url='http://api.ipinfodb.com/v3/ip-country/?key='+geoipAPIKey+'&format=json&ip='+encodeURIComponent(host);
} }
else { else {
if(isarray) if(isarray)
geoip_url='http://api.ipinfodb.com/v3/ip-city/?key='+geoipAPIKey+'&format=json&ip='+encodeURIComponent(host.join(',')); geoip_url='http://api.ipinfodb.com/v3/ip-city/?key='+geoipAPIKey+'&format=json&ip='+encodeURIComponent(host.join(','));
else if(ishost)
geoip_url='http://api.ipinfodb.com/v3/ip-city/?key='+geoipAPIKey+'&format=json&ip='+encodeURIComponent(host);
else else
geoip_url='http://api.ipinfodb.com/v3/ip-city/?key='+geoipAPIKey+'&format=json&ip='+encodeURIComponent(host); geoip_url='http://api.ipinfodb.com/v3/ip-city/?key='+geoipAPIKey+'&format=json&ip='+encodeURIComponent(host);
} }
......
...@@ -94,7 +94,7 @@ function HTTPRequest() ...@@ -94,7 +94,7 @@ function HTTPRequest()
this.response_headers=[]; this.response_headers=[];
for(;;) { for(;;) {
header=this.sock.recvline(4096); header=this.sock.recvline(4096, 120);
if(header==null) if(header==null)
throw("Unable to receive headers"); throw("Unable to receive headers");
if(header=='') if(header=='')
......
...@@ -621,7 +621,6 @@ Server_Commands["PRIVMSG"] = function (srv,cmd,onick,ouh) { ...@@ -621,7 +621,6 @@ Server_Commands["PRIVMSG"] = function (srv,cmd,onick,ouh) {
if(!cmd) return false; if(!cmd) return false;
if(cmd[0].length == 0) { if(cmd[0].length == 0) {
srv.o(chan.name,"Type '" + get_cmd_prefix() + "HELP' for a list of commands.");
return false; return false;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment