From c2089562c59fb5d1c17435b5f14c902baafa47a8 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Fri, 23 May 2014 05:03:54 +0000 Subject: [PATCH] Add registry entry for ChanServ ban timeout --- PBot/BanTracker.pm | 2 ++ PBot/IRCHandlers.pm | 4 ++-- PBot/VERSION.pm | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/PBot/BanTracker.pm b/PBot/BanTracker.pm index 46ed6f39..c8b26ee1 100644 --- a/PBot/BanTracker.pm +++ b/PBot/BanTracker.pm @@ -36,6 +36,8 @@ sub initialize { $self->{banlist} = {}; + $self->{pbot}->{registry}->add_default('text', 'bantracker', 'chanserv_ban_timeout', '604800'); + $pbot->{commands}->register(sub { return $self->dumpbans(@_) }, "dumpbans", 60); } diff --git a/PBot/IRCHandlers.pm b/PBot/IRCHandlers.pm index 36b01ec1..731e135c 100644 --- a/PBot/IRCHandlers.pm +++ b/PBot/IRCHandlers.pm @@ -144,7 +144,7 @@ sub on_mode { if(defined $target && $target eq $self->{pbot}->{registry}->get_value('irc', 'botnick')) { # bot targeted if($mode eq "+o") { $self->{pbot}->{logger}->log("$nick opped me in $channel\n"); - $self->{pbot}->{chanops}->{is_opped}->{$channel}{timeout} = gettimeofday + 300; # 5 minutes + $self->{pbot}->{chanops}->{is_opped}->{$channel}{timeout} = gettimeofday + $self->{pbot}->{registry}->get_value('general', 'deop_timeout');; $self->{pbot}->{chanops}->perform_op_commands($channel); } elsif($mode eq "-o") { @@ -159,7 +159,7 @@ sub on_mode { else { # bot not targeted if($mode eq "+b") { if($nick eq "ChanServ") { - $self->{pbot}->{chanops}->{unban_timeout}->hash->{$channel}->{$target}{timeout} = gettimeofday + 3600 * 2; # 2 hours + $self->{pbot}->{chanops}->{unban_timeout}->hash->{$channel}->{$target}{timeout} = gettimeofday + $self->{pbot}->{registry}->get_value('bantracker', 'chanserv_ban_timeout'); $self->{pbot}->{chanops}->{unban_timeout}->save; } } diff --git a/PBot/VERSION.pm b/PBot/VERSION.pm index 2c134f1f..57652373 100644 --- a/PBot/VERSION.pm +++ b/PBot/VERSION.pm @@ -13,8 +13,8 @@ use warnings; # These are set automatically by the build/commit script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 599, - BUILD_DATE => "2014-05-21", + BUILD_REVISION => 600, + BUILD_DATE => "2014-05-22", }; 1;