3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-27 06:19:25 +01:00

Fix some warnings

This commit is contained in:
Pragmatic Software 2017-11-27 19:17:28 -08:00
parent 6ac5c344fa
commit 356efe0a8a

View File

@ -194,7 +194,7 @@ sub module_pipe_reader {
return if $stuff->{result} =~ m/(?:no results)/i; return if $stuff->{result} =~ m/(?:no results)/i;
} }
if ($stuff->{special} eq 'code-factoid') { if (exists $stuff->{special} and $stuff->{special} eq 'code-factoid') {
$stuff->{result} =~ s/\s+$//g; $stuff->{result} =~ s/\s+$//g;
$self->{pbot}->{logger}->log("No text result from code-factoid.\n") and return if not length $stuff->{result}; $self->{pbot}->{logger}->log("No text result from code-factoid.\n") and return if not length $stuff->{result};
@ -209,7 +209,7 @@ sub module_pipe_reader {
$self->{pbot}->{interpreter}->handle_result($stuff, $stuff->{result}); $self->{pbot}->{interpreter}->handle_result($stuff, $stuff->{result});
} else { } else {
# don't override nick if already set # don't override nick if already set
if ($stuff->{special} ne 'code-factoid' and exists $self->{pbot}->{factoids}->{factoids}->hash->{$stuff->{channel}}->{$stuff->{trigger}}->{add_nick} and $self->{pbot}->{factoids}->{factoids}->hash->{$stuff->{channel}}->{$stuff->{trigger}}->{add_nick} != 0) { if (exists $stuff->{special} and $stuff->{special} ne 'code-factoid' and exists $self->{pbot}->{factoids}->{factoids}->hash->{$stuff->{channel}}->{$stuff->{trigger}}->{add_nick} and $self->{pbot}->{factoids}->{factoids}->hash->{$stuff->{channel}}->{$stuff->{trigger}}->{add_nick} != 0) {
$stuff->{nickoverride} = $stuff->{nick}; $stuff->{nickoverride} = $stuff->{nick};
} else { } else {
# extract nick-like thing from module result # extract nick-like thing from module result
@ -219,7 +219,7 @@ sub module_pipe_reader {
# put it back on result if it's a usage message # put it back on result if it's a usage message
$stuff->{result} = "$nick: $stuff->{result}"; $stuff->{result} = "$nick: $stuff->{result}";
} else { } else {
my $present = $self->{pbot}->{nicklist}->is_present($nick); my $present = $self->{pbot}->{nicklist}->is_present($stuff->{channel}, $nick);
if ($present) { if ($present) {
# nick is present in channel # nick is present in channel
$stuff->{nickoverride} = $present; $stuff->{nickoverride} = $present;