From 9b47e7023d41616a9efa885ef9338277dc2ab851 Mon Sep 17 00:00:00 2001 From: minima Date: Sun, 26 Mar 2006 18:36:01 +0000 Subject: [PATCH] reduce the amount of POSIX loaded. display buddies online at logon. --- Changes | 4 ++++ perl/DXBearing.pm | 2 +- perl/DXChannel.pm | 6 ++++-- perl/DXCommandmode.pm | 16 ++++++++++++++-- perl/DXProt.pm | 4 ++-- perl/Minimuf.pm | 4 +++- perl/Sun.pm | 4 +++- 7 files changed, 31 insertions(+), 9 deletions(-) diff --git a/Changes b/Changes index 81da8db8..7ce87a5a 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,7 @@ +26Mar06======================================================================= +1. Arrange for any online buddies to be displayed when a user logs on. +2. Try to reduce the amount of POSIX stuff that is loaded to just that which +is required. 23Mar06======================================================================= 1. Added cty-1603 data. 2. On the advice of Jim AD1C I have changed around some things in wpxloc.raw diff --git a/perl/DXBearing.pm b/perl/DXBearing.pm index e0e9910f..e3aac65e 100644 --- a/perl/DXBearing.pm +++ b/perl/DXBearing.pm @@ -13,8 +13,8 @@ package DXBearing; -use POSIX; use DXUtil; +use POSIX qw(:math_h); use strict; use vars qw($pi); diff --git a/perl/DXChannel.pm b/perl/DXChannel.pm index 45e8d39b..929e7e53 100644 --- a/perl/DXChannel.pm +++ b/perl/DXChannel.pm @@ -513,9 +513,11 @@ sub tell_login # sub tell_buddies { - my ($self, $m, $call) = @_; + my ($self, $m, $call, $node) = @_; $call ||= $self->{call}; + $call =~ s/-\d+$//; + my $s = $node ? "$node: $call" : $call; # send info to all logged in thingies my @dxchan = get_all_users(); @@ -523,7 +525,7 @@ sub tell_buddies foreach $dxchan (@dxchan) { next if $dxchan == $self; next if $dxchan->{call} eq $main::mycall; - $dxchan->send($dxchan->msg($m, $call)) if grep $_ eq $call, @{$dxchan->{user}->{buddies}} ; + $dxchan->send($dxchan->msg($m, $s)) if grep $_ eq $call, @{$dxchan->{user}->{buddies}} ; } } diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index 0e012087..919def9f 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -9,7 +9,7 @@ package DXCommandmode; -use POSIX; +#use POSIX; @ISA = qw(DXChannel); @@ -202,12 +202,24 @@ sub start 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}) { + my $s = $node eq $main::mycall ? $call : "$node: $call"; + $self->send($self->msg('loginb', $s)); + } + } + } + $self->lastmsgpoll($main::systime); $self->prompt; } diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 8a672744..53ca8ea3 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -847,7 +847,7 @@ sub handle_16 # send info to all logged in thingies $self->tell_login('loginu', "$ncall: $call") if DXUser->get_current($ncall)->is_local_node; - $self->tell_buddies('loginb', "$ncall: $call"); + $self->tell_buddies('loginb', $call, $ncall); # add this station to the user database, if required # $call =~ s/-\d+$//o; # remove ssid for users @@ -921,7 +921,7 @@ sub handle_17 # send info to all logged in thingies $self->tell_login('logoutu', "$ncall: $ucall") if DXUser->get_current($ncall)->is_local_node; - $self->tell_buddies('logoutb', "$ncall: $ucall"); + $self->tell_buddies('logoutb', $ucall, $ncall); if (eph_dup($line)) { dbg("PCPROT: dup PC17 detected") if isdbg('chanerr'); diff --git a/perl/Minimuf.pm b/perl/Minimuf.pm index 31986669..7f309979 100644 --- a/perl/Minimuf.pm +++ b/perl/Minimuf.pm @@ -36,7 +36,6 @@ package Minimuf; -use POSIX; require Exporter; @ISA = qw(Exporter); @@ -46,6 +45,9 @@ require Exporter; use strict; +use DXDebug; +use POSIX qw(:math_h); + use vars qw($VERSION $BRANCH); $VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ ); $BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ || (0,0)); diff --git a/perl/Sun.pm b/perl/Sun.pm index 6b9b88eb..301fa4a5 100644 --- a/perl/Sun.pm +++ b/perl/Sun.pm @@ -26,7 +26,6 @@ package Sun; -use POSIX; require Exporter; @ISA = qw(Exporter); @@ -50,6 +49,9 @@ use vars qw(%keps); use Keps; use DXVars; use DXUtil; +use DXDebug; + +use POSIX qw(:math_h); # reload the keps data sub load -- 2.43.0