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

Interpreter: $self is no longer passed through event queue

This commit is contained in:
Pragmatic Software 2020-03-06 20:23:44 -08:00
parent 5624d2d166
commit 857021f25f

View File

@ -941,8 +941,6 @@ sub add_message_to_output_queue {
$self->{pbot}->{timer}->enqueue_event( $self->{pbot}->{timer}->enqueue_event(
sub { sub {
my ($self) = @_;
my $stuff = { my $stuff = {
from => $channel, from => $channel,
nick => $message->{nick}, nick => $message->{nick},
@ -953,7 +951,7 @@ sub add_message_to_output_queue {
checkflood => $message->{checkflood} checkflood => $message->{checkflood}
}; };
$self->{pbot}->{interpreter}->output_result($stuff); $self->output_result($stuff);
}, },
$delay, "output $channel $message->{message}" $delay, "output $channel $message->{message}"
); );
@ -964,7 +962,6 @@ sub add_to_command_queue {
$self->{pbot}->{timer}->enqueue_event( $self->{pbot}->{timer}->enqueue_event(
sub { sub {
my ($self) = @_;
my $stuff = { my $stuff = {
from => $channel, from => $channel,
nick => $command->{nick}, nick => $command->{nick},
@ -981,9 +978,9 @@ sub add_to_command_queue {
$stuff->{'cap-override'} = $command->{'cap-override'}; $stuff->{'cap-override'} = $command->{'cap-override'};
} }
my $result = $self->{pbot}->{interpreter}->interpret($stuff); my $result = $self->interpret($stuff);
$stuff->{result} = $result; $stuff->{result} = $result;
$self->{pbot}->{interpreter}->handle_result($stuff, $result); $self->handle_result($stuff, $result);
}, },
$delay, "command $channel $command->{command}" $delay, "command $channel $command->{command}"
); );