From 55347ea463604698e1097b126b327517db95c4b9 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Wed, 28 Feb 2018 11:13:56 -0800 Subject: [PATCH] Sort Dumper output by keys --- PBot/BanTracker.pm | 6 ++++-- PBot/HashObject.pm | 2 +- PBot/IRCHandlers.pm | 1 + PBot/NickList.pm | 1 + 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/PBot/BanTracker.pm b/PBot/BanTracker.pm index 66c90873..7b45a546 100644 --- a/PBot/BanTracker.pm +++ b/PBot/BanTracker.pm @@ -18,6 +18,7 @@ use strict; use Time::HiRes qw/gettimeofday/; use Time::Duration; use Data::Dumper; +$Data::Dumper::Sortkeys = 1; use Carp (); sub new { @@ -60,11 +61,12 @@ sub get_banlist { my ($self, $event_type, $event) = @_; my $channel = lc $event->{event}->{args}[1]; + return 0 if not $self->{pbot}->{chanops}->can_gain_ops($channel); + delete $self->{banlist}->{$channel}; $self->{pbot}->{logger}->log("Retrieving banlist for $channel.\n"); - $event->{conn}->sl("mode $channel +b"); - $event->{conn}->sl("mode $channel +q"); + $event->{conn}->sl("mode $channel +bq"); return 0; } diff --git a/PBot/HashObject.pm b/PBot/HashObject.pm index 5cd53fb3..1ba7fff6 100644 --- a/PBot/HashObject.pm +++ b/PBot/HashObject.pm @@ -248,7 +248,7 @@ sub add { my ($self, $index_key, $hash) = @_; if($self->load_hash_add($index_key, $hash, 0)) { - $self->save_(); + $self->save(); } else { return "Error occurred adding new $self->{name} object."; } diff --git a/PBot/IRCHandlers.pm b/PBot/IRCHandlers.pm index 59641c3b..fc734431 100644 --- a/PBot/IRCHandlers.pm +++ b/PBot/IRCHandlers.pm @@ -15,6 +15,7 @@ use strict; use Carp(); use Time::HiRes qw(gettimeofday); use Data::Dumper; +$Data::Dumper::Sortkeys = 1; sub new { if(ref($_[1]) eq 'HASH') { diff --git a/PBot/NickList.pm b/PBot/NickList.pm index 0aa733fc..b0b950a9 100644 --- a/PBot/NickList.pm +++ b/PBot/NickList.pm @@ -16,6 +16,7 @@ use strict; use Text::Levenshtein qw/fastdistance/; use Data::Dumper; +$Data::Dumper::Sortkeys = 1; use Carp (); use Time::HiRes qw/gettimeofday/;