diff --git a/lib/RevBank/Messages.pm b/lib/RevBank/Messages.pm index 09ff0bf..7027efd 100644 --- a/lib/RevBank/Messages.pm +++ b/lib/RevBank/Messages.pm @@ -41,6 +41,14 @@ sub hook_cart_changed($class, $cart, @) { } } +sub hook_checkout($class, $cart, $user, $transaction_id, @) { + if ($cart->changed) { + say "Done:"; + $cart->display; + } + say "Transaction ID: $transaction_id"; +} + sub hook_abort($class, $cart, @) { say "\e[1;4mABORTING TRANSACTION.\e[0m"; } diff --git a/plugins/users b/plugins/users index 34492cf..ffab966 100644 --- a/plugins/users +++ b/plugins/users @@ -22,14 +22,6 @@ sub command :Tab(list,ls,shame,log,USERS) ($self, $cart, $command, @) { return ACCEPT; } -sub hook_checkout($class, $cart, $user, $transaction_id, @) { - if ($cart->changed) { - say "Done:"; - $cart->display; - } - say "Transaction ID: $transaction_id"; -} - sub list($self) { require RevBank::TextEditor; diff --git a/revbank b/revbank index 4d4d008..0017eb9 100755 --- a/revbank +++ b/revbank @@ -55,7 +55,7 @@ my $retry; # reason (text) my @retry; # (@accepted, $rejected, [@trailing]) OUTER: for (;;) { - if (not @words or $words[0] eq "\0SEPARATOR") { + if (not @words) { call_hooks("cart_changed", $cart) if $cart->changed; print "\n"; }