From 0b9f0846b89c35dd6d92dcca815f49af1682924d Mon Sep 17 00:00:00 2001 From: minima Date: Wed, 23 Feb 2005 16:11:09 +0000 Subject: [PATCH] fix before_send logic --- perl/AMsg.pm | 1 - perl/Thingy.pm | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/perl/AMsg.pm b/perl/AMsg.pm index 4ca43cb4..4738403a 100644 --- a/perl/AMsg.pm +++ b/perl/AMsg.pm @@ -126,7 +126,6 @@ sub new_client { $conn->{outbound} = 0; $conn->{state} = 'WH'; # wait for return authorize my $thing = $conn->{lastthing} = Thingy::Hello->new(); - $thing->send($conn, 'Aranea'); dbg("-> D $conn->{peerhost} $thing->{Aranea}") if isdbg('chan'); } diff --git a/perl/Thingy.pm b/perl/Thingy.pm index 308e80c3..10f20f28 100644 --- a/perl/Thingy.pm +++ b/perl/Thingy.pm @@ -74,7 +74,9 @@ sub send # before send (and line generation) things # function must return true to make the send happen $sub = "before_send_$class"; - return unless $thing->can($sub) && $thing->$sub($dxchan); + if ($thing->can($sub)) { + return $thing->$sub($dxchan); + } # generate the protocol line which may (or not) be cached my $ref; -- 2.34.1