From 6124bc502907801d72e7258a98aa4048444e637f Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sat, 4 Jan 2020 23:09:25 -0800 Subject: [PATCH] `list admins` now sorts by name field instead of hostmask --- PBot/FactoidCommands.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PBot/FactoidCommands.pm b/PBot/FactoidCommands.pm index b9c9cf7a..c2af01ee 100644 --- a/PBot/FactoidCommands.pm +++ b/PBot/FactoidCommands.pm @@ -746,11 +746,11 @@ sub list { foreach my $channel (sort keys %{ $self->{pbot}->{admins}->{admins}->hash }) { next if $from =~ m/^#/ and $channel ne $from and $channel ne '.*'; if ($last_channel ne $channel) { - $text .= $sep . ($channel eq ".*" ? "all" : $channel) . ": "; + $text .= $sep . ($channel eq ".*" ? "global" : $channel) . ": "; $last_channel = $channel; $sep = ""; } - foreach my $hostmask (sort keys %{ $self->{pbot}->{admins}->{admins}->hash->{$channel} }) { + foreach my $hostmask (sort { $self->{pbot}->{admins}->{admins}->hash->{$channel}->{$a}->{name} cmp $self->{pbot}->{admins}->{admins}->hash->{$channel}->{$b}->{name} } keys %{ $self->{pbot}->{admins}->{admins}->hash->{$channel} }) { $text .= $sep; $text .= "*" if $self->{pbot}->{admins}->{admins}->hash->{$channel}->{$hostmask}->{loggedin}; $text .= $self->{pbot}->{admins}->{admins}->hash->{$channel}->{$hostmask}->{name} . " (" . $self->{pbot}->{admins}->{admins}->hash->{$channel}->{$hostmask}->{level} . ")";