Skip to content
Snippets Groups Projects
Commit 07feb7b5 authored by cyan's avatar cyan
Browse files

Added support for default IP masks (i.e. *@192.168.144.*)

parent eae89dad
No related branches found
No related tags found
No related merge requests found
......@@ -164,11 +164,18 @@ function IRC_create_default_mask(uh) {
if (tmp[0][0] == "~")
tmp[0] = tmp[0].slice(1);
tmp[0] = tmp[0].slice(0,9); // always make sure there's room.
var uh_chopped = tmp[1].slice(tmp[1].indexOf(".")+1);
if (uh_chopped.indexOf(".") == -1)
uh_chopped = tmp[1];
else
uh_chopped = "*." + uh_chopped;
// Check to see if we're an IP address
var last_quad = tmp[1].slice(tmp[1].lastIndexOf(".")+1);
var uh_chopped;
if (last_quad == parseInt(last_quad)) { //ip
uh_chopped = tmp[1].slice(0,tmp[1].lastIndexOf(".")) + ".*";
} else { //hostname
uh_chopped = tmp[1].slice(tmp[1].indexOf(".")+1);
if (uh_chopped.indexOf(".") == -1)
uh_chopped = tmp[1];
else
uh_chopped = "*." + uh_chopped;
}
return "*" + tmp[0] + "@" + uh_chopped;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment