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;
31 # first deal with copies
32 if ($f[0] eq 'C' || $f[0] eq 'CC' || $f[0] eq 'COPY') {
35 if (uc $f[$i] eq 'RR') {
39 my $oref = DXMsg::get($f[$i]);
40 #return (0, $self->msg('esend1', $f[$i])) if !$oref;
41 #return (0, $self->msg('esend2')) if $i+1 > @f;
42 return (0, "msgno $f[$i] not found") if !$oref;
43 return (0, "need a callsign") if $i+1 > @f;
45 # separate copy to everyone listed
46 for ($i++ ; $i < @f; $i++) {
47 my $msgno = DXMsg::next_transno('Msgno');
48 my $newsubj = "CC: " . $oref->subject;
49 my $nref = DXMsg->alloc($msgno,
59 my $from = $oref->from;
61 my $date = cldate($oref->t);
62 my $time = ztime($oref->t);
63 my $buf = "Original from: $from To: $to Date: $date $time";
65 push @list, $oref->read_msg_body();
68 #push @out, $self->msg('sendcc', $oref->msgno, $f[$i]);
69 push @out, "copy of msg $oref->{msgno} sent to $to";
75 # now deal with real message inputs
76 # parse out send line for various possibilities
77 $loc = $self->{loc} = {};
81 $loc->{private} = '1';
82 if ($f[0] eq 'B' || $f[0] =~ /^NOP/oi) {
83 $loc->{private} = '0';
85 } elsif ($f[0] eq 'P' || $f[0] =~ /^PRI/oi) {
90 if (uc $f[$i] eq 'RR') {
95 # check we have some callsigns
98 #return (0, $self->msg('esend2'));
99 return (0, "need a callsign");
102 # now save all the 'to' callsigns for later
103 my @to = @f[ $i..$#f ];
106 # find me and set the state and the function on my state variable to
107 # keep calling me for every line until I relinquish control
108 $self->func("DXMsg::do_send_stuff");
109 $self->state('send1');
110 #push @out, $self->msg('sendsubj');
111 push @out, "Enter Subject (30 characters) >";