6 # send <call> [<call> .. ]
7 # send private <call> [<call> .. ]
8 # send private rr <call> [<call> .. ]
9 # send rr <call> [<call> .. ]
10 # send noprivate <call> [<call> .. ]
11 # send b <call> [<call> .. ]
12 # send copy <call> [<call> .. ]
13 # send copy rr <call> [<call> .. ]
15 # Copyright (c) Dirk Koopman G1TLH
19 my ($self, $line) = @_;
20 return (1, $self->msg('e5')) if $self->remotecmd;
23 my $loc = $self->{loc} = {};
28 $loc->{private} = '1';
33 if ($self->state eq "prompt") {
35 my @f = split /\b/, $line;
36 @f = map {s/\s+//g; length $_ ? $_ : ()} @f;
38 # any thing after send?
39 return (1, $self->msg('e6')) if !@f;
44 # first deal with copies
45 if ($f eq 'C' || $f eq 'CC' || $f eq 'COPY') {
47 if (@f && uc $f[0] eq 'RR') {
54 my $oref = DXMsg::get($m);
55 return (0, $self->msg('m4', $m)) unless $oref;
56 return (0, $self->msg('m16')) unless @f;
58 # separate copy to everyone listed
60 my $newcall = uc shift @f;
61 my $msgno = DXMsg::next_transno('Msgno');
62 my $newsubj = "CC: " . $oref->subject;
63 my $nref = DXMsg->alloc($msgno,
73 my $from = $oref->from;
75 my $date = cldate($oref->t);
76 my $time = ztime($oref->t);
77 my $buf = "Original from: $from To: $to Date: $date $time";
79 push @list, $oref->read_msg_body();
82 push @out, $self->msg('m2', $oref->msgno, $newcall);
89 # private / noprivate / rr
90 if ($notincalls && ($f eq 'B' || $f =~ /^NOP/oi)) {
91 $loc->{private} = '0';
92 } elsif ($notincalls && ($f eq 'P' || $f =~ /^PRI/oi)) {
94 } elsif ($notincalls && ($f eq 'RR')) {
96 } elsif ($f eq '<' && @f) { # this is bbs syntax for from call
97 $loc->{from} = uc shift @f;
98 } elsif (($f =~ /^[\@\.\#\$]$/ || $f eq '.#') && @f) { # this is bbs syntax, for send it 'to node'
100 } elsif ($f =~ /^\$/) { # this is bbs syntax for a bid
102 } elsif ($f =~ /^<(\S+)/) { # this is bbs syntax for from call
104 } elsif ($f =~ /^\$\S+/) { # this is bbs syntax for bid
111 # is this callsign a distro?
112 my $fn = "/spider/msg/distro/$f.pl";
114 my $fh = new IO::File $fn;
121 return (1, "Error in Distro $f.pl:", $@) if $@;
129 if (grep $_ eq $f, @DXMsg::badmsg) {
130 push @out, $self->msg('m3', $f);
137 # check we have some callsigns
142 return (1, $self->msg('e6'));
144 $loc->{from} ||= $self->call;
145 unless (is_callsign($loc->{from})) {
147 return (1, $self->msg('e22', $loc->{from}));
150 # find me and set the state and the function on my state variable to
151 # keep calling me for every line until I relinquish control
152 $self->func("DXMsg::do_send_stuff");
153 $self->state('send1');
154 push @out, $self->msg('m1');
156 push @out, $self->msg('m17', $self->state);