X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXCommandmode.pm;h=c1a461ff640791c40cb5b9e90d5d13a5afcf1976;hb=3fe821fd8a168bc7175080838c4e3a4b30a86812;hp=32b1f86c4cade33ca79f84a633b43d2f5f2aec99;hpb=101516b420ac77cd9eb8294651104e43f3461c06;p=spider.git diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index 32b1f86c..c1a461ff 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -32,7 +32,7 @@ use Sun; use Internet; use strict; -use vars qw(%Cache %cmd_cache $errstr %aliases $scriptbase $maxerrors); +use vars qw(%Cache %cmd_cache $errstr %aliases $scriptbase $maxerrors %nothereslug); %Cache = (); # cache of dynamically loaded routine's mod times %cmd_cache = (); # cache of short names @@ -105,8 +105,6 @@ sub start $user->qra(DXBearing::lltoqra($lat, $long)) if (defined $lat && defined $long); } - $DXProt::me->conn($self->conn) if $call eq $main::myalias; # send all output for mycall to myalias - Log('DXCommand', "$call connected"); # send prompts and things @@ -393,6 +391,12 @@ sub process $dxchan->t($t); } } + + while (my ($k, $v) = each %nothereslug) { + if ($main::systime >= $v + 300) { + delete $nothereslug{$k}; + } + } } # @@ -403,11 +407,6 @@ sub disconnect my $self = shift; my $call = $self->call; - # reset the redirection of messages back to 'normal' if we are the sysop - if ($call eq $main::myalias) { - $DXProt::me->conn(undef); - } - my @rout = $main::routeroot->del_user($call); dbg("B/C PC17 on $main::mycall for: $call") if isdbg('route'); @@ -644,6 +643,19 @@ sub talk $line =~ s/\\5E/\^/g; $self->send("$to de $from: $line") if $self->{talk}; Log('talk', $to, $from, $main::mycall, $line); + # send a 'not here' message if required + unless ($self->{here} && $from ne $to) { + my $key = "$to$from"; + unless (exists $nothereslug{$key}) { + my ($ref, $dxchan); + if (($ref = Route::get($from)) && ($dxchan = $ref->dxchan)) { + my $name = $self->user->name || $to; + my $s = $self->user->nothere || $dxchan->msg('nothere', $name); + $nothereslug{$key} = $main::systime; + $dxchan->talk($to, $from, undef, $s); + } + } + } } # send an announce