summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/classes.pl6
-rw-r--r--modules/command.pl3
-rw-r--r--modules/event.pl4
-rw-r--r--modules/inspect.pl1
-rw-r--r--modules/mysql.pl2
-rw-r--r--modules/services.pl10
6 files changed, 21 insertions, 5 deletions
diff --git a/modules/classes.pl b/modules/classes.pl
index 1897100..74a5b1c 100644
--- a/modules/classes.pl
+++ b/modules/classes.pl
@@ -75,7 +75,9 @@ sub levenflood
sub dnsbl
{
my ($chk, $id, $event, $chan, $rev) = @_;
- return unless index($event->{host}, '/') == -1;
+# return unless index($event->{host}, '/') == -1;
+# hopefully getting rid of this won't cause shit to assplode
+# but I'm getting rid of it so it can detect cgi:irc shit
if (defined $rev) {
my $iaddr = gethostbyname( "$rev$chk->{content}" );
my @dnsbl = unpack( 'C4', $iaddr ) if defined $iaddr;
@@ -89,6 +91,7 @@ sub dnsbl
print "chk->content: $chk->{content}\n";
print "strip: $strip\n";
print "result: " . $::dnsbl->{query}->{$chk->{content}}->{response}->{$strip}->{content} . "\n";
+ $::sn{lc $event->{nick}}->{dnsbl} = 1;
# lol really icky hax
return $::dnsbl->{query}->{$chk->{content}}->{response}->{$strip}->{content};
}
@@ -250,6 +253,7 @@ sub gecos {
sub nuhg {
my ( $chk, $id, $event, $chan) = @_;
+ return 0 unless defined($::sn{lc $event->{nick}}->{gecos});
my $match = $event->{from} . '!' . $::sn{lc $event->{nick}}->{gecos};
return 1 if ($match =~ /$chk->{content}/);
return 0;
diff --git a/modules/command.pl b/modules/command.pl
index 07ef31e..889a3de 100644
--- a/modules/command.pl
+++ b/modules/command.pl
@@ -2,6 +2,7 @@ package ASM::Commander;
use warnings;
use strict;
use IO::All;
+use POSIX qw(strftime);
sub new
{
@@ -41,7 +42,7 @@ sub command
}
}
if ($cmd=~/$command->{cmd}/) {
- print "$event->{from} told me: $cmd \n";
+ print strftime("%F %T ", gmtime) . "$event->{from} told me: $cmd \n";
eval $command->{content};
warn $@ if $@;
last;
diff --git a/modules/event.pl b/modules/event.pl
index f808317..e25066b 100644
--- a/modules/event.pl
+++ b/modules/event.pl
@@ -5,6 +5,7 @@ use strict;
use Data::Dumper;
use Text::LevenshteinXS qw(distance);
use IO::All;
+use POSIX qw(strftime);
sub cs {
my ($chan) = @_;
@@ -100,6 +101,7 @@ sub on_join {
} else {
$::sn{$nick} = {};
$::sn{$nick}->{mship} = [ $chan ];
+ $::sn{$nick}->{dnsbl} = 0;
if (defined($::needgeco{$nick})) {
$::needgeco{$nick} = [ @{$::needgeco{$nick}}, $evcopy ];
$::db->logg($event);
@@ -363,7 +365,7 @@ sub whois_identified {
foreach my $item (@{$::idqueue{$who}}) {
my ($cmd, $command, $event) = @{$item};
if ( $cmd =~ /$command->{cmd}/ ){
- print "$event->{from} told me $cmd \n";
+ print strftime("%F %T ", gmtime) . "$event->{from} told me $cmd \n";
eval $command->{content};
warn $@ if $@;
}
diff --git a/modules/inspect.pl b/modules/inspect.pl
index 6e992ec..84c20a1 100644
--- a/modules/inspect.pl
+++ b/modules/inspect.pl
@@ -26,6 +26,7 @@ sub inspect {
our $unmode='';
my $nick = lc $event->{nick};
my $xresult;
+ return if (index($nick, ".") != -1);
return if (defined($::eline{$nick}) || defined($::eline{lc $event->{user}}) || defined($::eline{lc $event->{host}}));
if ( $event->{host} =~ /gateway\/web\/ajax\// ) {
if ( $event->{user} =~ /.=([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])/ ) {
diff --git a/modules/mysql.pl b/modules/mysql.pl
index f0b7845..e5470bb 100644
--- a/modules/mysql.pl
+++ b/modules/mysql.pl
@@ -134,7 +134,7 @@ sub query
$host =~ s/\*/%/g;
$host =~ s/_/\\_/g;
$host =~ s/\?/_/g;
- my $sth = $dbh->prepare("SELECT * from $self->{TABLE} WHERE channel = $channel and nick like $nick and user like $user and host like $host;");
+ my $sth = $dbh->prepare("SELECT * from $self->{TABLE} WHERE channel like $channel and nick like $nick and user like $user and host like $host;");
$sth->execute;
my $i = 0;
while (my $ref = $sth->fetchrow_arrayref) {
diff --git a/modules/services.pl b/modules/services.pl
index 3ec9436..0a0c3d5 100644
--- a/modules/services.pl
+++ b/modules/services.pl
@@ -11,6 +11,7 @@ sub new
sub doServices {
my ($self, $conn, $event) = @_;
+ my $i = 5;
if ($event->{from} eq 'NickServ!NickServ@services.')
{
print "NickServ: $event->{args}->[0]\n";
@@ -20,7 +21,10 @@ sub doServices {
}
elsif ( $event->{args}->[0] =~ /^You are now identified/ )
{
- $conn->join($_) foreach ( @{$::settings->{autojoins}} );
+ foreach my $x ( @{$::settings->{autojoins}} ) {
+ $conn->schedule($i, sub { $conn->join($x); });
+ $i = $i + 6;
+ }
}
elsif ($event->{args}->[0] =~ /has been killed$/ )
{
@@ -42,6 +46,10 @@ sub doServices {
{
$conn->join($1);
}
+ elsif ( $event->{args}->[0] =~ /You are not authorized to perform this operation/ )
+ {
+ $::oq->clean();
+ }
}
}