) 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 );
}
}
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.",
# 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 =~ /^~.*/ ) {
$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 );
}