From: pdbogen Date: Mon, 3 Sep 2007 02:11:54 +0000 (+0000) Subject: Modify seen hook to provide more information (message that was seen, source, and... X-Git-Url: http://git.mmlx.us/?a=commitdiff_plain;h=e289af410732d606dc3f87e1dfbf38bba841e143;p=destult.git Modify seen hook to provide more information (message that was seen, source, and the private reply module). Modify the seen hook to automatically check for memos. git-svn-id: https://www.cernu.us/~pdbogen/svn/destult2@15 088b83a4-0077-4247-935c-42ec02c2848b --- diff --git a/core.pl b/core.pl index 1ee7795..292548d 100644 --- 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 --- 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" ); }