diff options
| author | 2015-12-25 21:52:37 +0400 | |
|---|---|---|
| committer | 2015-12-25 21:52:37 +0400 | |
| commit | 3ad48471cdaec8059be4945606d97c019f2e4ce0 (patch) | |
| tree | b921b20df890e38c0a7b5638fc42912ad40dcbc7 | |
| parent | 8aa897dc2ed6f342517daf97aaac881aa4fe62f4 (diff) | |
General code cleanup (removing unused functions / old commented out code / etc.)
| -rw-r--r-- | config-default/commands.xml | 2 | ||||
| -rw-r--r-- | lib/ASM/Classes.pm | 2 | ||||
| -rw-r--r-- | lib/ASM/DB.pm | 7 | ||||
| -rw-r--r-- | lib/ASM/Event.pm | 16 | ||||
| -rw-r--r-- | lib/ASM/Inspect.pm | 3 | ||||
| -rw-r--r-- | lib/ASM/Log.pm | 2 | ||||
| -rw-r--r-- | lib/ASM/Services.pm | 4 | ||||
| -rw-r--r-- | lib/ASM/Util.pm | 30 | ||||
| -rwxr-xr-x | meta.pl | 2 |
9 files changed, 5 insertions, 63 deletions
diff --git a/config-default/commands.xml b/config-default/commands.xml index 38c2d99..7a568de 100644 --- a/config-default/commands.xml +++ b/config-default/commands.xml @@ -736,7 +736,7 @@ </command> <command cmd="^;falsematch\b" flag="s"> <![CDATA[ - $conn->privmsg($event->replyto, 'To whitelist false matches for the impersonation check, have someone with the a flag run ";restrict nick LegitimateNickGoesHere +nonickbl_impersonate". Contact ilbelkyr if this issue reoccurs.'); + $conn->privmsg($event->replyto, 'To whitelist false matches for the impersonation check, have someone with the "a" flag run ";restrict nick LegitimateNickGoesHere +nonickbl_impersonate". Contact ilbelkyr if this issue reoccurs.'); ]]> </command> </commands> diff --git a/lib/ASM/Classes.pm b/lib/ASM/Classes.pm index 325b71d..2fae035 100644 --- a/lib/ASM/Classes.pm +++ b/lib/ASM/Classes.pm @@ -5,7 +5,6 @@ use warnings; use Text::LevenshteinXS qw(distance); use Data::Dumper; use Regexp::Wildcards; -use Carp qw(cluck); my %sf = (); @@ -193,7 +192,6 @@ sub dnsbl # return 0; if (defined $rev) { ASM::Util->dprint("Querying $rev$chk->{content}", "dnsbl"); - #cluck "Calling gethostbyname in dnsbl"; my $iaddr = gethostbyname( "$rev$chk->{content}" ); my @dnsbl = unpack( 'C4', $iaddr ) if defined $iaddr; my $strip; diff --git a/lib/ASM/DB.pm b/lib/ASM/DB.pm index b842deb..df7c896 100644 --- a/lib/ASM/DB.pm +++ b/lib/ASM/DB.pm @@ -19,13 +19,6 @@ sub new { return $self; } -#sub sql_connect -#{ -# $::dbh = DBI->connect("DBI:mysql:database=$::mysql->{db};host=$::mysql->{host};port=$::mysql->{port}", -# $::mysql->{user}, $::mysql->{pass}); -# $::dbh->{mysql_auto_reconnect} = 1; -#} - sub raw { my $self = shift; diff --git a/lib/ASM/Event.pm b/lib/ASM/Event.pm index 470056c..04046c4 100644 --- a/lib/ASM/Event.pm +++ b/lib/ASM/Event.pm @@ -3,27 +3,11 @@ use warnings; use strict; use Data::Dumper; -use Text::LevenshteinXS qw(distance); use IO::All; use POSIX qw(strftime); use Regexp::Wildcards; use HTTP::Request; -sub cs { - my ($chan) = @_; - $chan = lc $chan; - $chan =~ s/^[@+]//; - return $::channels->{channel}->{$chan} if ( defined($::channels->{channel}->{$chan}) ); - return $::channels->{channel}->{default}; -} - -sub maxlen { - my ($a, $b) = @_; - my ($la, $lb) = (length($a), length($b)); - return $la if ($la > $lb); - return $lb; -} - sub new { my $module = shift; diff --git a/lib/ASM/Inspect.pm b/lib/ASM/Inspect.pm index df515dc..bb885d2 100644 --- a/lib/ASM/Inspect.pm +++ b/lib/ASM/Inspect.pm @@ -1,12 +1,9 @@ package ASM::Inspect; use warnings; use strict; -use feature qw(say); use Data::Dumper; -#use List::Util qw(first); use String::Interpolate qw(interpolate); -use Carp qw(cluck); %::ignored = (); sub new diff --git a/lib/ASM/Log.pm b/lib/ASM/Log.pm index c2a2b72..b12f58d 100644 --- a/lib/ASM/Log.pm +++ b/lib/ASM/Log.pm @@ -3,7 +3,6 @@ package ASM::Log; use warnings; use strict; -#use IO::All; use POSIX qw(strftime); sub new @@ -105,7 +104,6 @@ sub logg if (defined($spy)) { say $spy "$chan: $nostamp"; } -# $_ >> io($path); } } diff --git a/lib/ASM/Services.pm b/lib/ASM/Services.pm index 2d4beb6..f88ddac 100644 --- a/lib/ASM/Services.pm +++ b/lib/ASM/Services.pm @@ -42,12 +42,12 @@ sub doServices { } elsif ($event->{args}->[0] =~ /has been (killed|released)/ ) { -# ASM::Util->dprint('Got kill/release successful from NickServ!', 'snotice'); + ASM::Util->dprint('Got kill/release successful from NickServ!', 'snotice'); $conn->nick( $::settings->{nick} ); } elsif ($event->{args}->[0] =~ /has been regained/ ) { -# ASM::Util->dprint('Got regain successful from nickserv!', 'snotice'); + ASM::Util->dprint('Got regain successful from nickserv!', 'snotice'); } elsif ($event->{args}->[0] =~ /Password Incorrect/ ) { diff --git a/lib/ASM/Util.pm b/lib/ASM/Util.pm index a13f673..325762b 100644 --- a/lib/ASM/Util.pm +++ b/lib/ASM/Util.pm @@ -6,7 +6,6 @@ use strict; use Term::ANSIColor qw (:constants); use Socket qw( inet_aton inet_ntoa ); use Data::Dumper; -use Carp qw(cluck); %::RISKS = ( @@ -116,7 +115,6 @@ sub speak #this item is a stub, dur sub hostip { - #cluck "Calling gethostbyname in hostip"; return gethostbyname($_[0]); } @@ -231,14 +229,7 @@ sub intToDottedQuad { sub dottedQuadToInt { my ($module, $dottedquad) = @_; -# my $ip_number = 0; -# my @octets = split(/\./, $dottedquad); -# foreach my $octet (@octets) { -# $ip_number <<= 8; -# $ip_number |= $octet; -# } -# return $ip_number; - return unpack('N', inet_aton($dottedquad)); + return unpack('N', inet_aton($dottedquad)); } sub getHostIP @@ -257,7 +248,6 @@ sub getHostIP my $host = join('.', unpack('C4', pack('N', (hex($splitip[6] . $splitip[7])^hex('ffffffff'))))); return dottedQuadToInt(undef, $host); } - #cluck "Calling gethostbyname in getHostIP"; my @resolve = gethostbyname($host); return unless @resolve; return dottedQuadToInt(undef, join('.', unpack('C4', $resolve[4]))); @@ -278,24 +268,6 @@ sub getNickIP return $ip; } return; -# if ( ($host =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/) or -# ($host =~ /^gateway\/web\/freenode\/ip\.(\d+)\.(\d+)\.(\d+)\.(\d+)$/) ) { -# #yay, easy IP! -# $::sn{$nick}{ip} = dottedQuadToInt(undef, "$1.$2.$3.$4"); -# return $::sn{$nick}{ip}; -# } elsif (index($host, '/') != -1) { -# return; -# } elsif ($host =~ /^2001:0:/) { -# my @splitip = split(/:/, $host); -# #I think I can just do (hex($splitip[6] . $splitip[7]) ^ hex('ffffffff')) here but meh -# my $host = join('.', unpack('C4', pack('N', (hex($splitip[6] . $splitip[7])^hex('ffffffff'))))); -# $::sn{$nick}{ip} = dottedQuadToInt(undef, $host); -# return $::sn{$nick}{ip}; -# } -# my @resolve = gethostbyname($::sn{$nick}{host}); -# return unless @resolve; -# $::sn{$nick}{ip} = dottedQuadToInt(undef, join('.', unpack('C4', $resolve[4]))); -# return $::sn{$nick}{ip}; } sub notRestricted { @@ -147,4 +147,4 @@ sub init { $irc->start(); } -init();
\ No newline at end of file +init(); |
