3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-26 22:09:26 +01:00

Add registry entry for ChanServ ban timeout

This commit is contained in:
Pragmatic Software 2014-05-23 05:03:54 +00:00
parent 5904a3f1f4
commit c2089562c5
3 changed files with 6 additions and 4 deletions

View File

@ -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);
}

View File

@ -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;
}
}

View File

@ -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;