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) = @_;
25 if ($self->state eq "prompt") {
27 my @f = split /\s+/, $line;
29 # any thing after send?
30 return (1, $self->msg('e6')) if !@f;
34 # first deal with copies
35 if ($f[0] eq 'C' || $f[0] eq 'CC' || $f[0] eq 'COPY') {
38 if (uc $f[$i] eq 'RR') {
42 my $oref = DXMsg::get($f[$i]);
43 #return (0, $self->msg('esend1', $f[$i])) if !$oref;
44 #return (0, $self->msg('esend2')) if $i+1 > @f;
45 return (0, "msgno $f[$i] not found") if !$oref;
46 return (0, "need a callsign") if $i+1 > @f;
48 # separate copy to everyone listed
49 for ($i++ ; $i < @f; $i++) {
50 my $msgno = DXMsg::next_transno('Msgno');
51 my $newsubj = "CC: " . $oref->subject;
52 my $nref = DXMsg->alloc($msgno,
62 my $from = $oref->from;
64 my $date = cldate($oref->t);
65 my $time = ztime($oref->t);
66 my $buf = "Original from: $from To: $to Date: $date $time";
68 push @list, $oref->read_msg_body();
71 push @out, $self->msg('m2', $oref->msgno, $to);
72 # push @out, "copy of msg $oref->{msgno} sent to $to";
78 # now deal with real message inputs
79 # parse out send line for various possibilities
80 $loc = $self->{loc} = {};
84 $loc->{private} = '1';
85 if ($f[0] eq 'B' || $f[0] =~ /^NOP/oi) {
86 $loc->{private} = '0';
88 } elsif ($f[0] eq 'P' || $f[0] =~ /^PRI/oi) {
93 if (uc $f[$i] eq 'RR') {
98 # check we have some callsigns
101 return (1, $self->msg('e6'));
104 # now save all the 'to' callsigns for later
105 # first check the 'to' addresses for 'badness'
108 foreach $t (@f[ $i..$#f ]) {
110 if (grep $_ eq $t, @DXMsg::badmsg) {
111 # push @out, "Sorry, $t is an unacceptable TO address";
112 push @out, $self->msg('m3', $t);
123 # find me and set the state and the function on my state variable to
124 # keep calling me for every line until I relinquish control
125 $self->func("DXMsg::do_send_stuff");
126 $self->state('send1');
127 push @out, $self->msg('m1');
128 #push @out, "Enter Subject (30 characters) >";