summaryrefslogtreecommitdiffstats
path: root/config-default/commands.xml
diff options
context:
space:
mode:
authorLibravatarWilliam Heimbigner <william.heimbigner@gmail.com>2015-12-20 03:22:44 +0400
committerLibravatarWilliam Heimbigner <william.heimbigner@gmail.com>2015-12-20 03:22:44 +0400
commit9ff93cc7e050fbf7117413a17b74a4112b72183d (patch)
tree3e5c6991b0a3e832b952b0e5ee9dc99d98367434 /config-default/commands.xml
parente052f5f45a96b9bf5ad4cea10a0533b724cc3a19 (diff)
Added ability to have regex-based blacklisting
Diffstat (limited to 'config-default/commands.xml')
-rw-r--r--config-default/commands.xml15
1 files changed, 13 insertions, 2 deletions
diff --git a/config-default/commands.xml b/config-default/commands.xml
index 463b2e6..38c2d99 100644
--- a/config-default/commands.xml
+++ b/config-default/commands.xml
@@ -649,7 +649,17 @@
my $str = lc $1;
use String::CRC32;
my $id = sprintf("%08x", crc32($str));
- $::blacklist->{string}->{$id} = { "content" => $str, "setby" => $event->nick, "settime" => strftime('%F', gmtime) };
+ $::blacklist->{string}->{$id} = { "content" => $str, "type" => "string", "setby" => $event->nick, "settime" => strftime('%F', gmtime) };
+ ASM::XML->writeBlacklist();
+ $conn->privmsg($event->replyto, "$str blacklisted with id $id, please use ;blreason $id reasonGoesHere to set a reason");
+ ]]>
+ </command>
+ <command cmd="^;blacklistpcre (.*)" flag="a">
+ <![CDATA[
+ my $str = lc $1;
+ use String::CRC32;
+ my $id = sprintf("%08x", crc32($str));
+ $::blacklist->{string}->{$id} = { "content" => $str, "type" => "pcre", "setby" => $event->nick, "settime" => strftime('%F', gmtime) };
ASM::XML->writeBlacklist();
$conn->privmsg($event->replyto, "$str blacklisted with id $id, please use ;blreason $id reasonGoesHere to set a reason");
]]>
@@ -713,8 +723,9 @@
my $setby = $::blacklist->{string}->{$id}->{setby};
my $settime = $::blacklist->{string}->{$id}->{settime};
my $reason = $::blacklist->{string}->{$id}->{reason};
+ my $type = $::blacklist->{string}->{$id}->{type};
$reason = 'none ever provided' unless defined($reason);
- $conn->privmsg($event->nick, "'$content' blacklisted by $setby on $settime with reason $reason");
+ $conn->privmsg($event->nick, "'$content' $type blacklisted by $setby on $settime with reason $reason");
if ($event->{to}->[0] =~ /^#/) {
$conn->privmsg($event->replyto, "Info on blacklist ID $id sent via PM");
}