+# if there is a line send it, otherwise add this call to the talk list
+# and set talk mode for command mode
+if ($line) {
+ my @bad;
+ if (@bad = BadWords::check($line)) {
+ $self->badcount(($self->badcount||0) + @bad);
+ Log('DXCommand', "$self->{call} swore: $line");
+ } else {
+ $dxchan->talk($self->call, $to, $via, $line) if $dxchan;
+ }
+} else {
+ my $s = $to;
+ $s .= ">$via" if $via;
+ my $ref = $self->talklist;
+ if ($ref) {
+ unless (grep { $_ eq $s } @$ref) {
+ $dxchan->talk($self->call, $to, $via, $self->msg('talkstart'));
+ $self->state('talk');
+ push @$ref, $s;
+ }
+ } else {
+ $self->talklist([ $s ]);
+ $dxchan->talk($self->call, $to, $via, $self->msg('talkstart'));
+ push @out, $self->msg('talkinst');
+ $self->state('talk');
+ }
+ push @out, $self->talk_prompt;