send only to commandmode users that are addressed
[spider.git] / perl / Thingy.pm
index efacdbb3219f0864a587098e841229abd404ee8a..5d7909cca930df91cf19e3a45710a0caee0bd9a7 100644 (file)
@@ -78,7 +78,7 @@ sub send
        # function must return true to make the send happen
        $sub = "before_send_$class";
        if ($thing->can($sub)) {
-               return $thing->$sub($dxchan);
+               return unless $thing->$sub($dxchan);
        }
        
        # generate the protocol line which may (or not) be cached
@@ -113,7 +113,8 @@ sub broadcast
        dbg("Thingy::broadcast: " . $thing->ascii) if isdbg('thing'); 
 
        my @dxchan;
-       my $to ||= $thing->{touser};
+       my $to ||= $thing->{route}; 
+       $to     ||= $thing->{touser};
        $to ||= $thing->{group};
        if ($to && is_callsign($to) && (my $ref = Route::get($to))) {
                dbg("Thingy::broadcast: routing for $to") if isdbg('thing');