From: minima <minima>
Date: Mon, 23 Jan 2006 23:15:38 +0000 (+0000)
Subject: get rcmd text largely working.
X-Git-Tag: 1.53~63
X-Git-Url: http://dxspider.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=8e2d2c3cf84c44ac9acffe4736b1cc2c6c70cbd9;p=spider.git

get rcmd text largely working.
---

diff --git a/perl/DXXml/Text.pm b/perl/DXXml/Text.pm
index 35c83191..a08cbda0 100644
--- a/perl/DXXml/Text.pm
+++ b/perl/DXXml/Text.pm
@@ -29,13 +29,17 @@ sub handle_input
 	my $self = shift;
 	my $dxchan = shift;
 
-	# this is always routed
-	if ($self->{to} eq $main::mycall ) {
-		my $r = DXChannel::get($main::myalias);
-		$dxchan = $r if $r;
+	if ($self->{to} eq $main::mycall) {
+		my $tochan = DXChannel::get($self->{u} || $main::myalias);
+		if ($tochan) {
+			my $ref = $self->tocmd;
+			$tochan->send($_) for (ref $ref ? @$ref : $ref);
+		} else {
+			dbg("no user or $main::myalias not online") if isdbg('chanerr');
+		}
+	} else {	
+		$self->route($dxchan);
 	}
-	$self->route($dxchan);
-
 }
 
 sub topcxx