start work on NP stuff seriously
[spider.git] / perl / DXMsg.pm
index bb80e6c1908183ffbb16bf027a34e76c30478243..552709ddd29680a922e2783e34c1376419a2837a 100644 (file)
@@ -435,7 +435,7 @@ sub notify
 {
        my $ref = shift;
        my $to = $ref->{to};
-       my $uref = DXUser->get($to);
+       my $uref = DXUser->get_current($to);
        my $dxchan = DXChannel->get($to);
        if (((*Net::SMTP && $email_server) || $email_prog) && $uref && $uref->wantemail) {
                my $email = $uref->email;
@@ -518,7 +518,7 @@ sub store
                        my $line;
                        $ref->{size} = 0;
                        foreach $line (@{$lines}) {
-                               $line =~ s/[\x00-\x08\x0a-\x1f\xf0-\xff]/./g;
+                               $line =~ s/[\x00-\x08\x0a-\x1f\x80-\x9f]/./g;
                                $ref->{size} += (length $line) + 1;
                                print $fh "$line\n";
                        }
@@ -724,7 +724,7 @@ sub queue_msg
                        $ref->stop_msg($node);
                        
                        # delay any outgoing messages that fail
-                       $ref->{waitt} = $main::systime + $waittime + rand(120) if $node ne $main::mycall;
+                       $ref->{waitt} = $main::systime + $waittime + int rand(120) if $node ne $main::mycall;
                        delete $ref->{lastt};
                        next;
                }
@@ -1086,6 +1086,24 @@ sub do_send_stuff
                        delete $self->{loc};
                        $self->func(undef);
                        $self->state('prompt');
+               } elsif ($line =~ m|^/+\w+|) {
+                       # this is a command that you want display for your own reference
+                       # or if it has TWO slashes is a command 
+                       $line =~ s|^/||;
+                       my $store = $line =~ s|^/+||;
+                       my @in = $self->run_cmd($line);
+                       push @out, @in;
+                       if ($store) {
+                               foreach my $l (@in) {
+                                       if (my @ans = BadWords::check($l)) {
+                                               $self->{badcount} += @ans;
+                                               Log('msg', $self->call . " used badwords: @ans to @{$loc->{to}} subject: '$loc->{subject}' in msg") unless $loc->{reject};
+                                               Log('msg', "line: $l");
+                                               $loc->{reject}++;
+                                       } 
+                                       push @{$loc->{lines}}, length($l) > 0 ? $l : " ";
+                               }
+                       }
                } else {
                        if (my @ans = BadWords::check($line)) {
                                $self->{badcount} += @ans;