3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-01 17:16:39 +02:00

Factoids: Fix undo/redo via DualIndexSQLiteObject

This commit is contained in:
Pragmatic Software 2020-03-19 18:58:24 -07:00
parent f0300f873a
commit cac4ac81ad
2 changed files with 5 additions and 3 deletions

View File

@ -501,8 +501,10 @@ sub get_data {
my $d = {};
foreach my $key (keys %{$stuff->[0]}) {
next if $key eq 'index1' or $key eq 'index2';
$self->{cache}->{$lc_index1}->{$lc_index2}->{$key} = $stuff->[0]->{$key};
$d->{$key} = $stuff->[0]->{key} if defined $stuff->[0]->{key};
if (defined $stuff->[0]->{$key}) {
$self->{cache}->{$lc_index1}->{$lc_index2}->{$key} = $stuff->[0]->{$key};
$d->{$key} = $stuff->[0]->{$key};
}
}
my $timeout = $self->{pbot}->{registry}->get_value('dualindexsqliteobject', 'cache_timeout') // 60 * 30;

View File

@ -130,8 +130,8 @@ sub add_factoid {
};
}
$self->{commands}->log_factoid($channel, $trigger, $owner, "created: $action") unless $dont_save;
$self->{factoids}->add($channel, $trigger, $data, $dont_save);
$self->{commands}->log_factoid($channel, $trigger, $owner, "created: $action") unless $dont_save;
}
sub remove_factoid {