X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FThingy.pm;fp=perl%2FThingy.pm;h=efacdbb3219f0864a587098e841229abd404ee8a;hb=b03b8dda6a611e21b9e3d9c632c9a5fd68c36129;hp=0ab70dcf95359b0bb792b012eabeee19009492f0;hpb=5fc468a5ca08ec51a9b6994605db183b273b9184;p=spider.git diff --git a/perl/Thingy.pm b/perl/Thingy.pm index 0ab70dcf..efacdbb3 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; } @@ -241,9 +242,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};