package DXCommandmode;
-use POSIX;
+#use POSIX;
@ISA = qw(DXChannel);
+use POSIX qw(:math_h);
use DXUtil;
use DXChannel;
use DXUser;
$self->{priv} = 0 if $line =~ /^(ax|te)/ && !$self->conn->{usedpasswd};
# get the filters
- $self->{spotsfilter} = Filter::read_in('spots', $call, 0) || Filter::read_in('spots', 'user_default', 0);
- $self->{wwvfilter} = Filter::read_in('wwv', $call, 0) || Filter::read_in('wwv', 'user_default', 0);
- $self->{wcyfilter} = Filter::read_in('wcy', $call, 0) || Filter::read_in('wcy', 'user_default', 0);
- $self->{annfilter} = Filter::read_in('ann', $call, 0) || Filter::read_in('ann', 'user_default', 0) ;
+ my $nossid = $call;
+ $nossid =~ s/-\d+$//;
+
+ $self->{spotsfilter} = Filter::read_in('spots', $call, 0)
+ || Filter::read_in('spots', $nossid, 0)
+ || Filter::read_in('spots', 'user_default', 0);
+ $self->{wwvfilter} = Filter::read_in('wwv', $call, 0)
+ || Filter::read_in('wwv', $nossid, 0)
+ || Filter::read_in('wwv', 'user_default', 0);
+ $self->{wcyfilter} = Filter::read_in('wcy', $call, 0)
+ || Filter::read_in('wcy', $nossid, 0)
+ || Filter::read_in('wcy', 'user_default', 0);
+ $self->{annfilter} = Filter::read_in('ann', $call, 0)
+ || Filter::read_in('ann', $nossid, 0)
+ || Filter::read_in('ann', 'user_default', 0) ;
# clean up qra locators
my $qra = $user->qra;
my $info = Route::cluster();
$self->send("Cluster:$info");
- # send prompts and things
+ # send prompts for qth, name and things
$self->send($self->msg('namee1')) if !$user->name;
$self->send($self->msg('qthe1')) if !$user->qth;
$self->send($self->msg('qll')) if !$user->qra || (!$user->lat && !$user->long);
$self->send($self->msg('hnodee1')) if !$user->qth;
$self->send($self->msg('m9')) if DXMsg::for_me($call);
+
+ # send out any buddy messages for other people that are online
+ foreach my $call (@{$user->buddies}) {
+ my $ref = Route::User::get($call);
+ if ($ref) {
+ foreach my $node (@{$ref->parent}) {
+ $self->send($self->msg($node eq $main::mycall ? 'loginb' : 'loginbn', $call, $node));
+ }
+ }
+ }
+
$self->lastmsgpoll($main::systime);
$self->prompt;
}
# send info to all logged in thingies
$self->tell_login('logoutu');
- $self->tell_login('logoutb');
+ $self->tell_buddies('logoutb');
LogDbg('DXCommand', "$call disconnected");