From 6c8aece60b4a5e117a8643d428948055a419d93b Mon Sep 17 00:00:00 2001 From: pdbogen Date: Tue, 28 Oct 2008 15:47:52 +0000 Subject: [PATCH] Move all of the handling out of the IRC module and into the core. Yaay lower coupling. git-svn-id: https://www.cernu.us/~pdbogen/svn/destult2@71 088b83a4-0077-4247-935c-42ec02c2848b --- irc.pl | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/irc.pl b/irc.pl index 05ee84f..71b3a62 100644 --- a/irc.pl +++ b/irc.pl @@ -196,29 +196,7 @@ sub on_public { $msg =~ s/(\x3)[0-9]{0,2}//g; $msg =~ s/\x02//g; $cmd = ( split( / /, $msg, 2 ) )[0]; - if( $bridged ) { - $kernel->post( "core", "seen", $who, $msg, $self->{ "ssid" }, $dest->[0], "send_public_to" ); - } else { - $kernel->post( "core", "seen", $who, $msg, $self->{ "ssid" }, $who, "send_private" ); - } - if( $cmd =~ /^[~].*/ ) { - $kernel->post( "core", "cmd", $who, $msg, $self->{ "ssid" }, $dest->[0], "send_public_to" ); - } else { - if( $msg =~ m!(https?://[^[:space:]]+)!i && $self->{ "trapEnabled" } == 1 && length($1) >= 30 ) { - print( "IRC : URL Trapped: '$1' from $who\n" ); - my $url = $1; - if( $self->{ "trap" } ) { - $kernel->post( "core", "cmd", $who, "SHORTEN ".$self->{ "trap" }." $url", $self->{ "ssid" }, $dest->[0], "send_public_to" ); - } else { - $kernel->post( "core", "cmd", $who, "SHORTEN $url", $self->{ "ssid" }, $dest->[0], "send_public_to" ); - } - } - if( $msg =~ m/^([^ ]+)--$/ ) { - $kernel->post( "core", "cmd", $who, "KARMADOWN $1", $self->{ "ssid"}, $dest->[0], "send_public_to" ); - } elsif( $msg =~ m/^([^ ]+)\+\+$/ && $msg !~ m/DC\+\+$/i ) { - $kernel->post( "core", "cmd", $who, "KARMAUP $1", $self->{ "ssid"}, $dest->[0], "send_public_to" ); - } - } + $kernel->post( "core", "core_public", $who, $msg, $self->{ "ssid" }, $dest->[0], "send_public_to" ); } sub on_private { -- 2.11.0