projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added TODO list
[spider.git]
/
cmd
/
send.pl
diff --git
a/cmd/send.pl
b/cmd/send.pl
index f6f9e40f762550bb5b9b0ef911860e8827abebce..b728d38791fd886ea6acdad5754141019bcbb96e 100644
(file)
--- a/
cmd/send.pl
+++ b/
cmd/send.pl
@@
-32,10
+32,13
@@
$loc->{rrreq} = '0';
if ($self->state eq "prompt") {
if ($self->state eq "prompt") {
- my @f = split /\s+/, $line;
-
+ my @f = split /([\s\@\$,])/, $line;
+ @f = map {s/\s+//g; length $_ ? $_ : ()} @f;
+ @f = grep {$_ ne ','} @f;
+
# any thing after send?
return (1, $self->msg('e6')) if !@f;
# any thing after send?
return (1, $self->msg('e6')) if !@f;
+ return (1, $self->msg('e28')) unless $self->registered || uc $f[0] eq $main::myalias;
while (@f) {
my $f = uc shift @f;
while (@f) {
my $f = uc shift @f;
@@
-94,19
+97,21
@@
if ($self->state eq "prompt") {
$loc->{rrreq} = '1';
} elsif ($f eq '<' && @f) { # this is bbs syntax for from call
$loc->{from} = uc shift @f;
$loc->{rrreq} = '1';
} elsif ($f eq '<' && @f) { # this is bbs syntax for from call
$loc->{from} = uc shift @f;
- } elsif (
$f eq '@' && @f) { # this is bbs syntax, for origin
-
$loc->{origin} = uc
shift @f;
+ } elsif (
($f =~ /^[\@\.\#\$]$/ || $f eq '.#') && @f) { # this is bbs syntax, for send it 'to node'
+ shift @f;
} elsif ($f =~ /^\$/) { # this is bbs syntax for a bid
next;
} elsif ($f =~ /^\$/) { # this is bbs syntax for a bid
next;
- } elsif ($f =~ /^<
\S+
/) { # this is bbs syntax for from call
-
($loc->{from}) = $f =~ /^<(\S+)$/
;
- } elsif ($f =~ /^\
@\S+/) { # this is bbs syntax for origin
-
($loc->{origin}) = $f =~ /^\@(\S+)$/
;
+ } elsif ($f =~ /^<
(\S+)
/) { # this is bbs syntax for from call
+
$loc->{from} = $1
;
+ } elsif ($f =~ /^\
$\S+/) { # this is bbs syntax for bid
+ ;
} else {
# callsign ?
$notincalls = 0;
} else {
# callsign ?
$notincalls = 0;
+# $DB::single = 1;
+
# is this callsign a distro?
my $fn = "/spider/msg/distro/$f.pl";
if (-e $fn) {
# is this callsign a distro?
my $fn = "/spider/msg/distro/$f.pl";
if (-e $fn) {
@@
-125,10
+130,14
@@
if ($self->state eq "prompt") {
}
}
}
}
- if (grep $_ eq $f, @DXMsg::badmsg) {
- push @out, $self->msg('m3', $f);
+ if (($loc->{private} && is_callsign($f)) || (!$loc->{private} && DXMsg::valid_bull_addr($f))) {
+ if (grep $_ eq $f, @DXMsg::badmsg) {
+ push @out, $self->msg('m3', $f);
+ } else {
+ push @to, $f;
+ }
} else {
} else {
- push @
to, $f
;
+ push @
out, $self->msg('m3', $f)
;
}
}
}
}
}
}
@@
-138,7
+147,12
@@
if ($self->state eq "prompt") {
$loc->{to} = \@to;
} else {
delete $self->{loc};
$loc->{to} = \@to;
} else {
delete $self->{loc};
- return (1, $self->msg('e6'));
+ return (1, @out, $self->msg('e6'));
+ }
+ $loc->{from} ||= $self->call;
+ unless (is_callsign($loc->{from})) {
+ delete $self->{loc};
+ return (1, $self->msg('e22', $loc->{from}));
}
# find me and set the state and the function on my state variable to
}
# find me and set the state and the function on my state variable to
@@
-146,6
+160,8
@@
if ($self->state eq "prompt") {
$self->func("DXMsg::do_send_stuff");
$self->state('send1');
push @out, $self->msg('m1');
$self->func("DXMsg::do_send_stuff");
$self->state('send1');
push @out, $self->msg('m1');
+} else {
+ push @out, $self->msg('m17', $self->state);
}
return (1, @out);
}
return (1, @out);