From 487b2a304268a9825e071fc76238749a821ea056 Mon Sep 17 00:00:00 2001 From: minima Date: Fri, 11 Mar 2005 22:35:43 +0000 Subject: [PATCH] send only to commandmode users that are addressed --- perl/Thingy.pm | 2 +- perl/Thingy/Ping.pm | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/perl/Thingy.pm b/perl/Thingy.pm index 24c8b98f..5d7909cc 100644 --- a/perl/Thingy.pm +++ b/perl/Thingy.pm @@ -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 diff --git a/perl/Thingy/Ping.pm b/perl/Thingy/Ping.pm index d3fa90f4..a1ab4599 100644 --- a/perl/Thingy/Ping.pm +++ b/perl/Thingy/Ping.pm @@ -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; } -- 2.34.1