5. Change the badwords interface to be the same as baddx, badspotter et al.
[spider.git] / perl / DXCommandmode.pm
index 6986a41aa60b1d8188dbc06d7ce4715a32eb35c1..a5aaa5cfebd1f122c1b68b274d166e3c613774bf 100644 (file)
@@ -705,10 +705,10 @@ sub announce
        my $text = shift;
        my ($filter, $hops);
 
-       if ($suppress_ann_to_talk) {
-               my ($to, $call) = $text =~ /^\s*([\w-]+)[\s:]+([\w-]+)/;
-               return if ($to && $call && ((uc $to =~ /^TO?$/ && is_callsign(uc $call)) || is_callsign($call = uc $to)));
-       }       
+       if ($suppress_ann_to_talk && $to ne $self->{call}) {
+               my $call = AnnTalk::is_talk_candidate($_[0], $text);
+               return if $call && Route::get($call);
+       }
 
        if ($self->{annfilter}) {
                ($filter, $hops) = $self->{annfilter}->it(@_ );