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

Fix undefined variable warnings in recall

This commit is contained in:
Pragmatic Software 2015-09-03 20:50:07 -07:00
parent 675760289c
commit d570dd7dd4

View File

@ -246,9 +246,12 @@ sub recall_message {
$recall_history = shift @$args if not defined $recall_history;
$recall_channel = shift @$args if not defined $recall_channel;
$recall_count = 1 if $recall_count <= 0;
$recall_count = 1 if (not defined $recall_count) || ($recall_count <= 0);
return "You may only select a count of up to 50 messages." if $recall_count > 50;
$recall_before = 0 if not defined $recall_before;
$recall_after = 0 if not defined $recall_after;
if ($recall_before + $recall_after > 200) {
return "You may only select up to 200 lines of surrounding context.";
}
@ -264,6 +267,8 @@ sub recall_message {
$recall_channel = $temp;
}
$recall_history = 1 if not defined $recall_history;
# swap history and channel if history looks like a channel and neither history or channel were specified
if(not $channel_arg and not $history_arg and $recall_history =~ m/^#/) {
my $temp = $recall_history;