change touser login in gen_DXProt
[spider.git] / perl / Thingy / Ping.pm
index c8bf3a610c7dbc8db8c6dbce37cc3fbeea1a889b..902347dc30ec3a8f176bf9c30189d56407acc7b0 100644 (file)
@@ -59,7 +59,7 @@ sub gen_DXProt
            $from ||= $thing->{user} if Route::Node::get($thing->{user});
                $from ||= $thing->{origin};
                my $to = $thing->{o} unless $thing->{out};
-               $to ||= $thing->{touser} if Route::Node::get($thing->{touser});
+               $to ||= $thing->{touser} unless Route::User::get($thing->{touser});
                $to ||= $thing->{group};
 
                
@@ -72,7 +72,10 @@ sub gen_DXCommandmode
 {
        my $thing = shift;
        my $dxchan = shift;
-       my $buf = $dxchan->msg('pingi', ($thing->{user} || $thing->{origin}), $thing->{ft}, $thing->{fave});
+       my $buf;
+       if ($dxchan->{call} eq $thing->{touser}) {
+               $buf = $dxchan->msg('pingi', ($thing->{user} || $thing->{origin}), $thing->{ft}, $thing->{fave});
+       }
        return $buf;
 }
 
@@ -140,7 +143,6 @@ sub handle
                        }
                }
        } else {
-               $thing->{route} = $thing->{o} if $thing->{o};
                $thing->broadcast($dxchan);
        }
 }