3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-05 10:58:44 +02:00

Improve factmove detection of channel

This commit is contained in:
Pragmatic Software 2017-08-23 19:18:14 -07:00
parent 23c2c3d84e
commit 6f9d9aba07

View File

@ -460,6 +460,7 @@ sub factmove {
} }
$target_channel = lc $target_channel; $target_channel = lc $target_channel;
$target_channel = '.*' if $target_channel !~ /^#/;
$factoids->{$target_channel}->{$target} = $factoids->{$found_src_channel}->{$found_source}; $factoids->{$target_channel}->{$target} = $factoids->{$found_src_channel}->{$found_source};
delete $factoids->{$found_src_channel}->{$found_source}; delete $factoids->{$found_src_channel}->{$found_source};
@ -710,11 +711,11 @@ sub factshow {
if (not defined $trig) { if (not defined $trig) {
$trig = $chan; $trig = $chan;
$chan = '.*'; $chan = $from;
$needs_disambig = 1; $needs_disambig = 1;
} }
$chan = '.*' if $chan eq 'global'; $chan = '.*' if $chan !~ /^#/;
$chan = lc $chan; $chan = lc $chan;
@ -752,6 +753,9 @@ sub factshow {
$result .= ' [module]'; $result .= ' [module]';
} }
$channel = 'global' if $channel eq '.*';
$chan = 'global' if $chan eq '.*';
$result = "[$channel] $result" if $channel ne $chan; $result = "[$channel] $result" if $channel ne $chan;
return $result; return $result;