]> ruin.nu Git - NDIRC.git/blobdiff - Delling.pm
Convert all input strings to utf-8
[NDIRC.git] / Delling.pm
index 224a6572650bfccd2109e34016d87a8d96ece066..8008e810f2e9523d1bab6f91052817e56b1e9806 100644 (file)
@@ -36,7 +36,7 @@ has hal => (
        lazy_build => 1,
 );
 
-sub irc_public {
+after irc_public => sub {
        my ($self,$sender, $who, $where, $msg) = @_[OBJECT,SENDER, ARG0 .. ARG2];
        my ($nick,$username,$address) = ( split /[!@]/, $who );
        my $channel = $where->[0];
@@ -63,9 +63,9 @@ sub irc_public {
        if ($self->parseCommand($msg,$irc,$nick,$address,$channel,$dbh)){
                #Command parsed and run successfully
        }
-}
+};
 
-sub irc_msg {
+after irc_msg => sub {
        my ($self,$sender, $who, $where, $msg) = @_[OBJECT,SENDER, ARG0 .. ARG2];
        my ($nick,$username,$address) = ( split /[!@]/, $who );
        my $irc = $sender->get_heap();
@@ -79,7 +79,7 @@ sub irc_msg {
        }else{
                $irc->yield(notice => $nick, "unknown command");
        }
-}
+};
 
 sub irc_join {
        my ($self,$sender, $who, $channel) = @_[OBJECT,SENDER, ARG0 .. ARG1];