logo

ap-client

CLI-based client / toolbox for ActivityPub Client-to-Servergit clone https://hacktivis.me/git/ap-client.git
commit: 50e7ba37fd2d90de0223da07c93db1361c11fc1f
parent 4824c0dfb88347af1d13a448e0c71805c576f091
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Tue, 28 Mar 2023 07:51:58 +0200

PrettyPrint: Move regular_keys in a variable

Diffstat:

Mlib/ActivityPub/PrettyPrint.pm8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/ActivityPub/PrettyPrint.pm b/lib/ActivityPub/PrettyPrint.pm @@ -25,6 +25,9 @@ sub print_object_key { sub print_object { my ($indent, $object) = @_; + my @regular_keys = + qw{url subtitleLanguage context inbox outbox prev next published updated summary content bcc bto cc to object attachment tag orderedItems mediaType}; + printf "%*s %s", $indent, '⇒', $object->{"type"}; printf ' id:<%s>', $object->{"id"} if $object->{"id"}; printf ' href:<%s>', $object->{"href"} if $object->{"href"}; @@ -32,10 +35,7 @@ sub print_object { printf ' @%s', $object->{"preferredUsername"} if $object->{"preferredUsername"}; printf ' ⚠' if ($object->{"sensitive"} eq JSON->true); - foreach ( - qw{url subtitleLanguage context inbox outbox prev next published updated summary content bcc bto cc to object attachment tag orderedItems mediaType} - ) - { + foreach (@regular_keys) { print_object_key($indent, $object, $_); } }