3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-02 08:59:26 +01:00

Temporarily fix /msg, sort of

This commit is contained in:
Pragmatic Software 2017-11-23 14:12:23 -08:00
parent cea2fc66f9
commit a7f298520d

View File

@ -259,6 +259,8 @@ sub interpret {
$self->{pbot}->{logger}->log("piping: [$args][$pipe][$rest]\n"); $self->{pbot}->{logger}->log("piping: [$args][$pipe][$rest]\n");
$stuff->{prepend} = '/say ' unless exists $self->{pipe};
$stuff->{arguments} = $args; $stuff->{arguments} = $args;
$stuff->{pipe} = $pipe; $stuff->{pipe} = $pipe;
$stuff->{pipe_rest} = $rest; $stuff->{pipe_rest} = $rest;
@ -352,7 +354,7 @@ sub handle_result {
return 0; return 0;
} }
if ($stuff->{pipe}) { if ($stuff->{pipe} and not $stuff->{authorized}) {
my ($pipe, $pipe_rest) = ($stuff->{pipe}, $stuff->{pipe_rest}); my ($pipe, $pipe_rest) = ($stuff->{pipe}, $stuff->{pipe_rest});
delete $stuff->{pipe}; delete $stuff->{pipe};
@ -362,10 +364,12 @@ sub handle_result {
if ($result =~ s{^(/say |/me )}{}i) { if ($result =~ s{^(/say |/me )}{}i) {
$stuff->{prepend} = $1; $stuff->{prepend} = $1;
} elsif ($result =~ s{^/msg ([^ ]+) }{}i) { }
=cut
elsif ($result =~ s{^/msg ([^ ]+) }{}i) {
$stuff->{prepend} = "/msg $1 "; $stuff->{prepend} = "/msg $1 ";
} }
=cut
$stuff->{command} = "$pipe $result$pipe_rest"; $stuff->{command} = "$pipe $result$pipe_rest";
$result = $self->interpret($stuff); $result = $self->interpret($stuff);
@ -377,7 +381,7 @@ sub handle_result {
if ($stuff->{prepend}) { if ($stuff->{prepend}) {
# FIXME: do this better # FIXME: do this better
if ($result =~ m{^(/say |/me )}i) { if ($result =~ m{^(/say |/me )}i) {
} elsif ($result =~ m{^/msg ([^ ]+) }i) { # } elsif ($result =~ m{^/msg ([^ ]+) }i) {
} elsif ($result =~ m{^/kick }i) { } elsif ($result =~ m{^/kick }i) {
} else { } else {
$result = "$stuff->{prepend}$result"; $result = "$stuff->{prepend}$result";