From b1f79daf4b768228c1972624ef138648fe908b49 Mon Sep 17 00:00:00 2001 From: Gregory Bartholomew Date: Dec 29 2021 00:35:53 +0000 Subject: Fix show proposed and show agreed --- diff --git a/bot/commands.pm b/bot/commands.pm index d20883a..5cf4064 100644 --- a/bot/commands.pm +++ b/bot/commands.pm @@ -27,10 +27,9 @@ use subs 'list', 'view', 'move', 'card', 'ping'; use feature 'refaliasing', 'declared_refs'; -# the accessors for the Pagure state are private to this module -my \@_crd = \@commands::pagure::_crd; -my \$_col = \$commands::pagure::_col; -my \$_row = \$commands::pagure::_row; +our \@crd = \@commands::pagure::crd; +our \$col = \$commands::pagure::col; +our \$row = \$commands::pagure::row; *list = \&commands::pagure::list; *view = \&commands::pagure::view; @@ -152,10 +151,12 @@ my sub _topic { sub next { my $what = shift || 'card'; + our $col; + if ($what eq 'card') { return view; } elsif ($what =~ m{^col(?:umn)?$}) { - $_col++ if ($_col < $#{&::KBCOLUMN}); + $col++ if ($col < $#{&::KBCOLUMN}); return list; } elsif ($what eq 'topic') { return _topic(); @@ -181,12 +182,15 @@ sub show { my $what = shift; my $text = String::Tagged->new(); + our @crd; + our $col; + if ($what eq 'proposed' or $what eq 'agreed') { - if ((&::KBCOLUMN)->[$_col] ne COLUMN) { + if ((&::KBCOLUMN)->[$col] ne COLUMN) { $text .= 'error: wrong kanban column'; } else { - $text .= _sched($what, @_crd); - $text .= KEY if ($what eq 'agreed' && @_crd); + $text .= _sched($what, @crd); + $text .= KEY if ($what eq 'agreed' && @crd); } } elsif ($what eq 'schedule') { $text .= commands::schedule::show();