to => '0,To',
from => '0,From',
t => '0,Msg Time,cldatetime',
- private => '5,Private',
+ private => '5,Private,yesno',
subject => '0,Subject',
linesreq => '0,Lines per Gob',
- rrreq => '5,Read Confirm',
+ rrreq => '5,Read Confirm,yesno',
origin => '0,Origin',
lines => '5,Data',
stream => '9,Stream No',
if (exists $busy{$fromnode}) {
my $ref = $busy{$fromnode};
- my $tonode = $ref->{tonode};
+ my $tonode = $ref->{tonode} || "unknown";
dbg("Busy, stopping msgno: $ref->{msgno} $fromnode->$tonode") if isdbg('msg');
$ref->stop_msg($self->call);
}
if ($ref->{subject} eq $m->{subject} && $ref->{t} == $m->{t} && $ref->{from} eq $m->{from} && $ref->{to} eq $m->{to}) {
$ref->stop_msg($self->call);
my $msgno = $m->{msgno};
- dbg("duplicate message from $ref->{from} -> $ref->{to} to $msgno") if isdbg('msg');
- Log('msg', "duplicate message from $ref->{from} -> $ref->{to} to $msgno");
+ dbg("duplicate message from $ref->{from} -> $ref->{to} to msg: $msgno") if isdbg('msg');
+ Log('msg', "duplicate message from $ref->{from} -> $ref->{to} to msg: $msgno");
return;
}
}
return;
}
+ # check the message for bad words
+ my @words;
+ for (@{$ref->{lines}}) {
+ push @words, BadWords::check($_);
+ }
+ push @words, BadWords::check($ref->{subject});
+ if (@words) {
+ dbg("message with badwords '@words' $ref->{from} -> $ref->{to} '$ref->{subject}' origin: $ref->{origin}") if isdbg('msg');
+ Log('msg',"message with badwords '@words' $ref->{from} -> $ref->{to} origin: $ref->{origin}");
+ Log('msg',"subject: $ref->{subject}");
+ for (@{$ref->{lines}}) {
+ Log('msg', "line: $_");
+ }
+ $ref->stop_msg($self->call);
+ return;
+ }
+
$ref->{msgno} = next_transno("Msgno");
push @{$ref->{gotit}}, $f[2]; # mark this up as being received
$ref->store($ref->{lines});
if ($_->{from} eq $f[1] && $_->{subject} eq $f[2]) {
$_->del_msg();
Log('msg', "Message $_->{msgno} from $_->{from} ($_->{subject}) fully deleted");
- DXProt::broadcast_ak1a($line, $self);
+ DXChannel::broadcast_nodes($line, $self);
}
}
}
next unless $ref->forward_it($call); # check the forwarding file
# if we are here we have a node that doesn't have this message
- $ref->start_msg($dxchan) if !get_busy($call) && $dxchan->state eq 'normal';
+ if (!get_busy($call) && $dxchan->state eq 'normal') {
+ $ref->start_msg($dxchan);
+ last;
+ }
}
}
# $DB::single = 1;
confess "local var gone missing" if !ref $self->{loc};
my $loc = $self->{loc};
+ if (my @ans = BadWords::check($line)) {
+ $self->{badcount} += @ans;
+ Log('msg', $self->call . " used badwords: @ans to @{$loc->{to}} in msg");
+ return ($self->msg('e17', @ans), $self->msg('m1'));
+ }
$loc->{subject} = $line;
$loc->{lines} = [];
$self->state('sendbody');
$self->func(undef);
$self->state('prompt');
} else {
+ if (my @ans = BadWords::check($line)) {
+ $self->{badcount} += @ans;
+ Log('msg', $self->call . " used badwords: @ans to @{$loc->{to}} subject: '$loc->{subject}' in msg");
+ Log('msg', "line: $line");
+ return ($self->msg('e17', @ans));
+ }
# i.e. it ain't and end or abort, therefore store the line
push @{$loc->{lines}}, length($line) > 0 ? $line : " ";
}
}
- return (1, @out);
+ return @out;
}
# return the standard directory line for this ref
my @msg = map { chomp; $_ } <MSG>;
close(MSG);
unlink($fn);
- my @out = import_one($DXProt::me, \@msg, $splitit);
+ my @out = import_one($main::me, \@msg, $splitit);
Log('msg', @out);
}
}