Move all of the handling out of the IRC module and into the core. Yaay lower coupling.
authorpdbogen <pdbogen@088b83a4-0077-4247-935c-42ec02c2848b>
Tue, 28 Oct 2008 15:47:52 +0000 (15:47 +0000)
committerpdbogen <pdbogen@088b83a4-0077-4247-935c-42ec02c2848b>
Tue, 28 Oct 2008 15:47:52 +0000 (15:47 +0000)
git-svn-id: https://www.cernu.us/~pdbogen/svn/destult2@71 088b83a4-0077-4247-935c-42ec02c2848b

irc.pl

diff --git a/irc.pl b/irc.pl
index 05ee84f..71b3a62 100644 (file)
--- 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 {