make sure group is set up correctly
authorminima <minima>
Mon, 7 Mar 2005 23:27:13 +0000 (23:27 +0000)
committerminima <minima>
Mon, 7 Mar 2005 23:27:13 +0000 (23:27 +0000)
perl/Thingy.pm

index 0ab70dcf95359b0bb792b012eabeee19009492f0..efacdbb3219f0864a587098e841229abd404ee8a 100644 (file)
@@ -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};