]> dxcluster.net Git - spider.git/commitdiff
2. fix console.pl to show blank lines more reliably.
authorminima <minima>
Tue, 6 Nov 2001 23:56:18 +0000 (23:56 +0000)
committerminima <minima>
Tue, 6 Nov 2001 23:56:18 +0000 (23:56 +0000)
3. fix msgs so that 2 R: lines are only stored on initial entry (not just
after forwarding).

Changes
perl/DXCommandmode.pm
perl/DXMsg.pm
perl/console.pl

diff --git a/Changes b/Changes
index 7201d694031d445b6b6055425d1755e8c25dd788..7988e3d85ed13862ecc7d5bfc0333ef6d161f1d1 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,6 +1,9 @@
 06Nov01=======================================================================
 1. fix read so that sysop reading doesn't increment the read counter for 
 private mail not addressed to them.
+2. fix console.pl to show blank lines more reliably.
+3. fix msgs so that 2 R: lines are only stored on initial entry (not just
+after forwarding).
 04Nov01=======================================================================
 1. Allow the user to equal the node in RSPF checks (this allows spots and 
 stuff with the origin and spotter to be the same (although it is STRONGLY 
index 6efd8cee4f47294833534aa170ee62c19f9d78f4..58b4296934c5a5ae0c6d44d81a5394ea01d9401c 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
        
index dbcd8097bafce544231a37f7e58565f55999e3c3..cd3bf74b0f757922abcb78545cd274899d31aa41 100644 (file)
@@ -1091,9 +1091,25 @@ sub do_send_stuff
                                Log('msg', "line: $line");
                                $loc->{reject}++;
                        }
+
+                       if (@{$loc->{lines}}) {
+                               push @{$loc->{lines}}, length($line) > 0 ? $line : " ";
+                       } else {
+                               # temporarily store any R: lines so that we end up with 
+                               # only the first and last ones stored.
+                               if ($line =~ m|^R:\d{6}/\d{4}|) {
+                                       push @{$loc->{tempr}}, $line;
+                               } else {
+                                       if (exists $loc->{tempr}) {
+                                               push @{$loc->{lines}}, shift @{$loc->{tempr}};
+                                               push @{$loc->{lines}}, pop @{$loc->{tempr}} if @{$loc->{tempr}};
+                                               delete $loc->{tempr};
+                                       }
+                                       push @{$loc->{lines}}, length($line) > 0 ? $line : " ";
+                               } 
+                       }
                        
                        # i.e. it ain't and end or abort, therefore store the line
-                       push @{$loc->{lines}}, length($line) > 0 ? $line : " ";
                }
        }
        return @out;
index 4dba480b03ea56b19d60b8d68a89b382a9d6cabe..fd033d90d66cb704d9efcb939344bbeac5522ab0 100755 (executable)
@@ -191,7 +191,7 @@ sub show_screen
                        my $lines = measure($line);
                        last if $i + $lines > $pagel;
                        setattr($line);
-                       $top->addstr($i, 0, $line);
+                       $top->addstr($i, 0, "$line\n");
                        $top->attrset(COLOR_PAIR(0)) if $has_colors;
                        $i += $lines;
                }
@@ -236,6 +236,7 @@ sub rec_socket
                my ($sort, $call, $line) = $msg =~ /^(\w)([^\|]+)\|(.*)$/;
                
                if ($sort && $sort eq 'D') {
+                       $line = " " unless $line;
                        addtotop($line);
                } elsif ($sort && $sort eq 'Z') { # end, disconnect, go, away .....
                        cease(0);
@@ -267,39 +268,38 @@ sub rec_stdin
                if ($r eq KEY_ENTER || $r eq "\n" || $r eq "\r") {
                        
                        # save the lines
-                       if ($inbuf) {
-                               # check for a pling and do a search back for a command
-                               if ($inbuf =~ /^!/o) {
-                                       my $i;
-                                       $inbuf =~ s/^!//o;
-                                       for ($i = $#khistory; $i >= 0; $i--) {
-                                               if ($khistory[$i] =~ /^$inbuf/) {
-                                                       $inbuf = $khistory[$i];
-                                                       last;
-                                               }
-                                       }
-                                       if ($i < 0) {
-                                               beep();
-                                               return;
+                       $inbuf = " " unless $inbuf;
+
+                       # check for a pling and do a search back for a command
+                       if ($inbuf =~ /^!/o) {
+                               my $i;
+                               $inbuf =~ s/^!//o;
+                               for ($i = $#khistory; $i >= 0; $i--) {
+                                       if ($khistory[$i] =~ /^$inbuf/) {
+                                               $inbuf = $khistory[$i];
+                                               last;
                                        }
                                }
-                               push @khistory, $inbuf if $inbuf;
-                               shift @khistory if @khistory > $maxkhist;
-                               $khistpos = @khistory;
-                               $bot->move(0,0);
-                               $bot->clrtoeol();
-                               $bot->addstr(substr($inbuf, 0, $cols));
+                               if ($i < 0) {
+                                       beep();
+                                       return;
+                               }
                        }
+                       push @khistory, $inbuf if $inbuf;
+                       shift @khistory if @khistory > $maxkhist;
+                       $khistpos = @khistory;
+                       $bot->move(0,0);
+                       $bot->clrtoeol();
+                       $bot->addstr(substr($inbuf, 0, $cols));
 
                        # add it to the monitor window
                        unless ($spos == @shistory) {
                                $spos = @shistory;
                                show_screen();
                        };
-                       addtotop($inbuf) if $inbuf;
+                       addtotop($inbuf);
                
                        # send it to the cluster
-                       $inbuf = " " unless $inbuf;
                        $conn->send_later("I$call|$inbuf");
                        $inbuf = "";
                        $pos = $lth = 0;