Hi everyone. i have been working on a support bot module for my chat system that needs to open a chat room and invite a support user and the client into it.
i have been trying to get the current vhost so i can do some user checking but i cant seem to get to it. i used $self->{vhost} but it doesn't return anything. i notice that the vhost and domain is used in DJabberd::Plugin::MUC::get_room. do i need to include some other modules to get at these variables? this is my process_text function. sub process_text { my ($self, $text, $from, $ctx) = @_; my $default_intro = "for support type support"; my $roomname = $from; $roomname =~ s/[EMAIL PROTECTED]//; my $domain = $self->{domain}; my $vhost = $self->{vhost}; # these don't return anything $logger->debug("domain : '$domain'"); $logger->debug("vhost : '$vhost'"); my $response = ""; $logger->debug("'$vhost': '$from' asking '$text'"); if ($text eq "support") { # open chat room my $room = DJabberd::Plugin::MUC::get_room($self. $roomname); # this kills the connection with the client but not the server. # invite support staff to chat room # really not sure how to do this either??? } elsif ($text eq "help") { $response = $default_intro; } else { $response = $default_intro; } $ctx->reply($response); } the error i get when the chat room creating fails is ERROR DJabberd.Connection.ClientIn 2 disconnected DJabberd::Connection::ClientIn=ARRAY(0x1cb2010) because: Can't use string ("DJabberd::Bot::ActiveTech=HASH(0") as a HASH ref while "strict refs" in use at lib/DJabberd/Plugin/MUC.pm line 224, <DATA> line 924. i am guessing that happens because $self->{domain} and $self->{vhost} don't exist. what am i doing wrong? thanks in advance Pete.