]> bicyclesonthemoon.info Git - botm/oldlogs/commitdiff
bugfix viewer after review
authorb <rowerynaksiezycu@gmail.com>
Mon, 9 Oct 2023 21:44:00 +0000 (21:44 +0000)
committerb <rowerynaksiezycu@gmail.com>
Mon, 9 Oct 2023 21:44:00 +0000 (21:44 +0000)
botm-common
bsta_lib.1.pm
viewer.1.pl

index c88ca49b964a50d81875ab64ccaf2f25c64b89f3..373116e970d4474d1154fdde9e9d0a033acd27e9 160000 (submodule)
@@ -1 +1 @@
-Subproject commit c88ca49b964a50d81875ab64ccaf2f25c64b89f3
+Subproject commit 373116e970d4474d1154fdde9e9d0a033acd27e9
index 42c700ed8baef8e9d5cd73b0c645122ff32b4dae..720cd7c14717d37aa5b6740ee9ad88877f39e530 100644 (file)
@@ -858,7 +858,7 @@ sub print_viewer_page {
        my $next_available = ($password_ok || ($next_frame <= $last_frame));
        my $prefetch_next  = (
                $password_ok ||
-               ($next_frame < $last_frame) || (
+               ($next_frame < $last_frame) || (  # avoid unseen trigger!
                        ($next_frame <= $last_frame) &&
                        ($ong_state >= STATE->{'ready'})
                )
@@ -877,14 +877,14 @@ sub print_viewer_page {
                )
        );
        my $show_command_link = ($next_available || (!$access));
-       my $show_command_cursor = (($frame == $last_frame) || ($command eq ''));
+       my $show_command_cursor = ((!$next_available) || ($command eq ''));
        my $frame_indirect = !(
                (!$access) || (
                        ($frame <= $last_frame) &&
                        ($ong_state > STATE->{'inactive'})
                )
        );
-       my $nextframe_indirect = !($next_frame < $last_frame);
+       my $nextframe_indirect = !($next_frame <= $last_frame);
        
        my $password_query;
        
@@ -934,7 +934,7 @@ sub print_viewer_page {
                        }}
                );
        }
-       my $frame_file = '';
+       my $frame_file;
        my $frame_url;
        my $frame_next_url;
        my $frame_normal_url;
@@ -982,14 +982,14 @@ sub print_viewer_page {
        
        if ($password_ok) {
                $password_query = url_query_encode({'p', $settings->{'password'}});
-               $goto_url        = merge_url($goto_url       , {'query' => $password_query});
-               $info_url        = merge_url($info_url       , {'query' => $password_query});
-               $bbcode_url      = merge_url($bbcode_url     , {'query' => $password_query});
-               $viewer_url      = merge_url($viewer_url     , {'query' => $password_query});
-               $viewer_0_url    = merge_url($viewer_0_url   , {'query' => $password_query});
-               $viewer_prev_url = merge_url($viewer_prev_url, {'query' => $password_query});
-               $viewer_next_url = merge_url($viewer_next_url, {'query' => $password_query});
-               $viewer_last_url = merge_url($viewer_last_url, {'query' => $password_query});
+               $goto_url        = merge_url($goto_url       , {'query' => $password_query, 'append_query' => 1});
+               $info_url        = merge_url($info_url       , {'query' => $password_query, 'append_query' => 1});
+               $bbcode_url      = merge_url($bbcode_url     , {'query' => $password_query, 'append_query' => 1});
+               $viewer_url      = merge_url($viewer_url     , {'query' => $password_query, 'append_query' => 1});
+               $viewer_0_url    = merge_url($viewer_0_url   , {'query' => $password_query, 'append_query' => 1});
+               $viewer_prev_url = merge_url($viewer_prev_url, {'query' => $password_query, 'append_query' => 1});
+               $viewer_next_url = merge_url($viewer_next_url, {'query' => $password_query, 'append_query' => 1});
+               $viewer_last_url = merge_url($viewer_last_url, {'query' => $password_query, 'append_query' => 1});
                if ($frame_indirect) {
                        $frame_url = merge_url($frame_url     , {'query' => $password_query});
                }
@@ -1024,6 +1024,8 @@ sub print_viewer_page {
                }
        }
        
+       # everything determined, now start generating
+       
        if (ref($file)) {
                $fh=$file;
                unless (seek($fh, 0, 0)) {
index 91d5d5c8faedf7de1568c28254a22cfb9af38475..5815ef19a11989e89705ae89f9c80b60faaeb4d3 100644 (file)
@@ -146,8 +146,8 @@ if (open ($state_file, "+<:encoding(UTF-8)", DATA_STATE_PATH())) {
                        my %new_state = %state;
                        unless (
                                ($state{'ip1'} eq $IP) ||
-                               ($state{'ip1'} eq $IP) ||
-                               ($state{'ip1'} eq $IP)
+                               ($state{'ip2'} eq $IP) ||
+                               ($state{'ip3'} eq $IP)
                        )
                        {
                                if ($state{'ip1'} eq '') {