rearrange spot broadcast so that it copes according to terminal type
[spider.git] / perl / DXCommandmode.pm
index 6efd8cee4f47294833534aa170ee62c19f9d78f4..791256dc7090a45b864e1c1ca230565d43d207ee 100644 (file)
@@ -89,7 +89,7 @@ sub start
        $self->{priv} = $user->priv || 0;
        $self->{lang} = $user->lang || $main::lang || 'en';
        $self->{pagelth} = $user->pagelth || 20;
-       ($self->{width}) = $line =~ /width=(\d+)/;
+       ($self->{width}) = $line =~ /width=(\d+)/; $line =~ s/\s*width=\d+\s*//;
        $self->{width} = 80 unless $self->{width} && $self->{width} > 80;
        $self->{consort} = $line;       # save the connection type
        
@@ -288,6 +288,7 @@ sub normal
                }
                if ($@) {
                        $self->send_ans("Syserr: on stored func $self->{func}", $@);
+                       delete $self->{func};
                        $self->state('prompt');
                        undef $@;
                }
@@ -785,7 +786,13 @@ sub dx_spot
                return unless $filter;
        }
 
-       my $buf = Spot::formatb($self->{user}->wantgrid, $_[0], $_[1], $_[2], $_[3], $_[4]);
+
+       my $t = ztime($_[2]);
+       my $ref = DXUser->get_current($_[4]);
+       my $loc = $ref->qra if $ref && $ref->qra && $self->{user}->wantgrid;
+       $loc = ' ' . substr($loc, 0, 4) if $loc;
+       $loc = "" unless $loc;
+       my $buf = sprintf "DX de %-7.7s%11.1f  %-12.12s %-*s $t$loc", "$_[4]:", $_[0], $_[1], $self->{consort} eq 'local' ? 29 : 30, $_[3];
        $buf .= "\a\a" if $self->{beep};
        $buf =~ s/\%5E/^/g;
        $self->local_send('X', $buf);