]> ruin.nu Git - NDIRC.git/blobdiff - Context.pm
Basic conversion to POE::Component::IRC
[NDIRC.git] / Context.pm
index abe59b24cf538b477f794153241a11649a1865b7..02aac95a7ba84819a49e6713acc7c241bec48d85 100644 (file)
@@ -97,16 +97,23 @@ sub check_user_roles {
 sub reply {
        my ($self,$msg) = @_;
 
-       $self->message($self->reply_string , $msg);
+       my @command = split / /, $self->reply_string;
+       $self->message(@command, $msg);
 }
 
 sub message {
-       my ($self,$command,$msg) = @_;
+       my ($self,$command, $target, $msg) = @_;
 
        $msg =~ s`<b>(.*?)</b>`${\(chr(2))}$1${\(chr(15))}`gi;
        $msg =~ s`<c(\d+)>(.*?)</c>`${\(chr(3))}$1$2${\(chr(15))}`gi;
 
-       $self->server->command("$command $msg");
+       $self->command($command, $target, $msg);
+}
+
+sub command {
+       my ($self,@command) = @_;
+
+       $self->server->yield(@command);
 }
 
 sub intel_log {