Fix some spurious warnings about untrusted sources.
authorpdbogen <pdbogen@088b83a4-0077-4247-935c-42ec02c2848b>
Thu, 4 Jun 2009 14:15:34 +0000 (14:15 +0000)
committerpdbogen <pdbogen@088b83a4-0077-4247-935c-42ec02c2848b>
Thu, 4 Jun 2009 14:15:34 +0000 (14:15 +0000)
git-svn-id: https://www.cernu.us/~pdbogen/svn/destult2@100 088b83a4-0077-4247-935c-42ec02c2848b

core.pl
irc.pl

diff --git a/core.pl b/core.pl
index 526bcb8..7ab74ac 100644 (file)
--- a/core.pl
+++ b/core.pl
@@ -34,13 +34,15 @@ POE::Session->create(
 ) or die( "Unable to create core POE session." );
 
 sub seen {
-       my( $kernel, $heap, $who ) = @_[ KERNEL, HEAP, ARG0 ];
+       my( $kernel, $heap, $who, $src, $trusted ) = @_[ KERNEL, HEAP, ARG0, ARG2, ARG5 ];
        if( !exists( $heap->{ 'seen' } ) ) {
                $heap->{ 'seen' } = { };
        }
        $heap->{ 'seen' }->{ uc( $who ) } = time;
-       if( exists( $heap->{ 'memo' } ) && exists( $heap->{ 'memo' }->{ uc( $who ) } ) ) {
-               $kernel->yield( "cmd", $who, "CHECKMEMO", $_[ARG2], $who, "send_private" );
+       if( exists( $heap->{ 'memo' } ) &&
+           exists( $heap->{ 'memo' }->{ uc( $who ) } ) && 
+           exists( $heap->{ 'identified' }->{ $src.uc( $who ) } ) ) {
+               $kernel->yield( "cmd", $who, "CHECKMEMO", $src, $who, "send_private", $trusted );
        }
 }
 
@@ -153,7 +155,7 @@ sub cmd {
 
        if( $Destult::config{ 'SECURITY' } =~ /high/i &&
            !exists $heap->{ 'identified' }->{ $src.uc( $who ) } &&
-           $cmd !~ /identify|register|title/i ) {
+           $cmd !~ /identify|register|title|seen/i ) {
                $kernel->post( $src,
                               "send_private",
                               "$who: Destult is operating in high security mode; all use must be from identified users. Please REGISTER and then IDENTIFY.",
@@ -239,7 +241,7 @@ sub advertise {
 # this should check for hooks stored on the heap. TODO.
 sub on_public {
        my( $kernel, $heap, $who, $what, $src, $dest, $replypath, $trusted ) = @_[ KERNEL, HEAP, ARG0, ARG1, ARG2, ARG3, ARG4, ARG5 ];
-       $kernel->yield( "seen", $who, $what, $src, $dest, $replypath );
+       $kernel->yield( "seen", $who, $what, $src, $dest, $replypath, $trusted );
        my $cmd = ( split( / /, $what, 2 ) )[0];
        # Check for the presence of a command
        if( $cmd =~ /^~.*/ ) {
diff --git a/irc.pl b/irc.pl
index 8a94a6b..0b8eee4 100644 (file)
--- a/irc.pl
+++ b/irc.pl
@@ -209,7 +209,7 @@ sub on_private {
        $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", 1 );
        $kernel->post( "core", "cmd", $who, $msg, $self->{ "ssid" }, $who, "send_private", 1 );
 }