]> dxcluster.net Git - spider.git/commitdiff
reduce the amount of POSIX loaded.
authorminima <minima>
Sun, 26 Mar 2006 18:36:01 +0000 (18:36 +0000)
committerminima <minima>
Sun, 26 Mar 2006 18:36:01 +0000 (18:36 +0000)
display buddies online at logon.

Changes
perl/DXBearing.pm
perl/DXChannel.pm
perl/DXCommandmode.pm
perl/DXProt.pm
perl/Minimuf.pm
perl/Sun.pm

diff --git a/Changes b/Changes
index 81da8db8610a52251127fa98a2658a9dcfe24d37..7ce87a5ad3eebb2412c34693f8228e86230cec10 100644 (file)
--- 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
index e0e9910f95ca4cb89832e15f8976f9f139d04b83..e3aac65e9ffee4ae8b18ae308104fcc7b9601769 100644 (file)
@@ -13,8 +13,8 @@
 
 package DXBearing;
 
-use POSIX;
 use DXUtil;
+use POSIX qw(:math_h);
 
 use strict;
 use vars qw($pi);
index 45e8d39b9904a3fd87374f4cc742558b39b1de24..929e7e530183ed71d62be1c2e4b9ff4701d122ed 100644 (file)
@@ -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}} ;
        }
 }
 
index 0e01208723a524fada6d2610e7f1cfb628115b91..919def9f67838c3bcb646c6c85414a396938f829 100644 (file)
@@ -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;
 }
index 8a672744b45395c7a02450910780cabcea03253c..53ca8ea37131662cbc0e3583e510c240eace6905 100644 (file)
@@ -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');
index 319866696bb3ad196ea268c91240693560406e1b..7f309979d7c30e8b89ae52249f6a50026933be26 100644 (file)
@@ -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));
index 6b9b88eb4da0edf6dc59656e2b6af2a8d270d986..301fa4a5b862906b55409d8025c64ae3915afe36 100644 (file)
@@ -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