6 # Copyright (c) Dirk Koopman, G1TLH
27 if ($self->{to} eq $main::mycall) {
30 my $cmd = $self->{content};
32 if ($self->{u} && $self->{u} eq $dxchan->call) { # online user or node
33 @in = (DXCommandmode::run_cmd($dxchan, $cmd));
36 my $ref = DXUser->get_current($self->{o});
37 my $cref = Route::Node::get($self->{o});
40 if ($cmd !~ /^\s*rcmd/i && $cref && $ref && $cref->call eq $ref->homenode) { # not allowed to relay RCMDS!
41 $self->{remotecmd} = 1; # for the benefit of any command that needs to know
42 my $oldpriv = $dxchan->{priv};
43 $dxchan->{priv} = $ref->{priv}; # assume the user's privilege level
44 @in = (DXCommandmode::run_cmd($dxchan, $cmd));
45 $dxchan->{priv} = $oldpriv;
46 delete $dxchan->{remotecmd};
51 Log('rcmd', 'in', $ref->{priv}, $self->{o}, "$self->{content}($answer)");
53 my $rep = DXXml::Text->new(u=>$self->{u}, to=>$self->{o}, content=>join('%0A', map {"$main::mycall:$_"} @in));
54 $rep->route($main::me); # because it's coming from me!
56 $self->route($dxchan);
64 my $ref = DXUser->get_current($self->{to});
67 if ($ref && $ref->is_clx && $self->{u}) {
68 $s = DXProt::pc84(($self->{o} || $main::mycall), $self->{to}, $self->{u}, $self->{content});
70 $s = DXProt::pc34(($self->{o} || $main::mycall), $self->{to}, $self->{content});
72 return $self->{'-pcxx'} = $s;