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

Search all channels if target channel is not a valid channel (private message, for instance)

This commit is contained in:
Pragmatic Software 2015-02-15 20:18:46 -08:00
parent 04f47ba3a1
commit ec13cf14bc

View File

@ -88,6 +88,7 @@ sub add_factoid {
my ($type, $channel, $owner, $trigger, $action, $dont_save) = @_;
$type = lc $type;
$channel = '.*' if $channel !~ /^#/;
$channel = lc $channel;
$self->{factoids}->hash->{$channel}->{$trigger}->{enabled} = 1;
@ -106,6 +107,7 @@ sub remove_factoid {
my $self = shift;
my ($channel, $trigger) = @_;
$channel = '.*' if $channel !~ /^#/;
$channel = lc $channel;
delete $self->{factoids}->hash->{$channel}->{$trigger};