X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FThingy.pm;h=24c8b98f78c72d5a682e24b3e3e16cf2c2039036;hb=eb09664039fe464e8aee4e9d921be96fb28b95e4;hp=0ab70dcf95359b0bb792b012eabeee19009492f0;hpb=dca951f539a50c396d7a94ad9f513a19892d54ad;p=spider.git diff --git a/perl/Thingy.pm b/perl/Thingy.pm index 0ab70dcf..24c8b98f 100644 --- a/perl/Thingy.pm +++ b/perl/Thingy.pm @@ -43,11 +43,12 @@ use DXUtil; sub new { my $class = shift; + my $pkg = ref $class || $class; my $thing = {@_}; $thing->{origin} ||= $main::mycall; - bless $thing, $class; + bless $thing, $pkg; return $thing; } @@ -112,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'); @@ -241,9 +243,11 @@ sub new_reply if ($thing->{group} eq $main::mycall) { $out = $thing->new; $out->{touser} = $thing->{user} if $thing->{user}; + $out->{group} = $thing->{origin}; } elsif (DXChannel::get($thing->{group})) { $out = $thing->new(user => $thing->{group}); $out->{touser} = $thing->{user} if $thing->{user}; + $out->{group} = $thing->{origin}; } elsif ($thing->{touser} && DXChannel::get($thing->{touser})) { $out = $thing->new(user => $thing->{touser}); $out->{group} = $thing->{group};