3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-23 11:12:42 +01:00

Fix some inconsistent arguments

This commit is contained in:
Pragmatic Software 2023-04-17 10:33:02 -07:00
parent 208df255a1
commit 860a6be156
4 changed files with 9 additions and 9 deletions

View File

@ -225,7 +225,7 @@ sub cmd_factundo($self, $context) {
}
}
$self->{pbot}->{factoids}->{data}->{storage}->add($channel, $trigger, $undos->{list}->[$undos->{idx}], 0, 1);
$self->{pbot}->{factoids}->{data}->{storage}->add($channel, $trigger, $undos->{list}->[$undos->{idx}]);
my $changes = $self->hash_differences_as_string($undos->{list}->[$undos->{idx} + 1], $undos->{list}->[$undos->{idx}]);
$self->log_factoid($channel, $trigger, $context->{hostmask}, "reverted (undo): $changes", 1);
@ -315,7 +315,7 @@ sub cmd_factredo($self, $context) {
$self->{pbot}->{logger}->log("Error storing undo: $@\n") if $@;
}
$self->{pbot}->{factoids}->{data}->{storage}->add($channel, $trigger, $undos->{list}->[$undos->{idx}], 0, 1);
$self->{pbot}->{factoids}->{data}->{storage}->add($channel, $trigger, $undos->{list}->[$undos->{idx}]);
my $changes = $self->hash_differences_as_string($undos->{list}->[$undos->{idx} - 1], $undos->{list}->[$undos->{idx}]);
@ -585,7 +585,7 @@ sub cmd_factmove($self, $context) {
my $data = $factoids->get_data($found_src_channel, $found_source);
$factoids->remove($found_src_channel, $found_source, undef, 1);
$factoids->add($target_channel, $target, $data, 0, 1);
$factoids->add($target_channel, $target, $data);
$found_src_channel = 'global' if $found_src_channel eq '.*';
$target_channel = 'global' if $target_channel eq '.*';

View File

@ -137,7 +137,7 @@ sub clear($self) {
$self->{hash} = {};
}
sub levenshtein_matches($self, $primary_index, $secondary_index, $distance = 0.60, $strictnamespace = 0) {
sub levenshtein_matches($self, $primary_index = undef, $secondary_index = undef, $distance = 0.60, $strictnamespace = 0) {
my $comma = '';
my $result = "";

View File

@ -9,17 +9,17 @@ package PBot::Core::Utils::SQLiteLoggerLayer;
use PBot::Imports;
sub PUSHED($class, $mode, $fh) {
sub PUSHED($class, $mode, $fh = undef) {
my $logger;
return bless \$logger, $class;
}
sub OPEN($self, $path, $mode, $fh) {
sub OPEN($self, $path, $mode = undef, $fh = undef) {
$$self = $path; # path is our PBot::Logger object
return 1;
}
sub WRITE($self, $buf, $fh) {
sub WRITE($self, $buf, $fh = undef) {
$$self->log($buf); # log message
return length($buf);
}

View File

@ -25,8 +25,8 @@ use PBot::Imports;
# These are set by the /misc/update_version script
use constant {
BUILD_NAME => "PBot",
BUILD_REVISION => 4648,
BUILD_DATE => "2023-04-13",
BUILD_REVISION => 4650,
BUILD_DATE => "2023-04-17",
};
sub initialize {}