Modify seen hook to provide more information (message that was seen, source, and...
authorpdbogen <pdbogen@088b83a4-0077-4247-935c-42ec02c2848b>
Mon, 3 Sep 2007 02:11:54 +0000 (02:11 +0000)
committerpdbogen <pdbogen@088b83a4-0077-4247-935c-42ec02c2848b>
Mon, 3 Sep 2007 02:11:54 +0000 (02:11 +0000)
git-svn-id: https://www.cernu.us/~pdbogen/svn/destult2@15 088b83a4-0077-4247-935c-42ec02c2848b

core.pl
irc.pl

diff --git a/core.pl b/core.pl
index 1ee7795..292548d 100644 (file)
--- a/core.pl
+++ b/core.pl
@@ -38,6 +38,9 @@ sub seen {
                $heap->{ 'seen' } = { };
        }
        $heap->{ 'seen' }->{ uc( $who ) } = time;
+       if( exists( $heap->{ 'memo' } ) && exists( $heap->{ 'memo' }->{ uc( $who ) } ) ) {
+               $kernel->yield( "cmd", $who, "CHECKMEMO", $_[ARG2], $_[ARG3], $_[ARG4] );
+       }
 }
 
 sub on_start {
diff --git a/irc.pl b/irc.pl
index 5547548..f183736 100644 (file)
--- a/irc.pl
+++ b/irc.pl
@@ -173,7 +173,7 @@ sub on_public {
        $msg =~ s/(\x3)[0-9]{0,2}//g;
        $msg =~ s/\x02//g;
        $cmd = ( split( / /, $msg, 2 ) )[0];
-       $kernel->post( "core", "seen", $who );
+       $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" );
        }