Updated to obey updated API.

This commit is contained in:
Elijah Perrault committed 2011-02-15 22:29:03 -07:00
1 parent 60cdd488ba
commit f97b55a56c
2 files changed
+14 -17

No files matched your search

+4 -5
View File
@@ -12,15 +12,14 @@ our (%usercmd);
# CTCP VERSION reply.
hook_add("on_uprivmsg", "ctcp_version_reply", sub {
my (($svr, @ex)) = @_;
my %src = usrc(substr($ex[0], 1));
my (($src, @msg)) = @_;
if ($ex[3] eq ":\001VERSION\001") {
if ($msg[0] eq "\001VERSION\001") {
if (Auto::RSTAGE ne 'd') {
notice($svr, $src{nick}, "\001VERSION ".Auto::NAME." ".Auto::VER.".".Auto::SVER.".".Auto::REV.Auto::RSTAGE." ".$OSNAME."\001");
notice($src->{svr}, $src->{nick}, "\001VERSION ".Auto::NAME." ".Auto::VER.".".Auto::SVER.".".Auto::REV.Auto::RSTAGE." ".$OSNAME."\001");
}
else {
notice($svr, $src{nick}, "\001VERSION ".Auto::NAME." ".Auto::VER.".".Auto::SVER.".".Auto::REV.Auto::RSTAGE."-".Auto::GR." ".$OSNAME."\001");
notice($src->{svr}, $src->{nick}, "\001VERSION ".Auto::NAME." ".Auto::VER.".".Auto::SVER.".".Auto::REV.Auto::RSTAGE."-".Auto::GR." ".$OSNAME."\001");
}
}
+10 -12
View File
@@ -36,14 +36,12 @@ sub _void
# Callback for act_on_badword hook.
sub actonbadword
{
my (($svr, @ex)) = @_;
my %src = API::IRC::usrc(substr $ex[0], 1);
my (($src, $chan, @msg)) = @_;
my $msg = substr $ex[3], 1;
for (my $i = 4; $i < scalar @ex; $i++) { $msg .= q{ }.$ex[$i]; }
my $msg = join ' ', @msg;
if (conf_get("badwords:$ex[2]:word")) {
my @words = @{ (conf_get("badwords:$ex[2]:word"))[0] };
if (conf_get("badwords:$chan:word")) {
my @words = @{ (conf_get("badwords:$chan:word"))[0] };
foreach (@words) {
my ($w, $a) = split m/[:]/, $_;
@@ -51,17 +49,17 @@ sub actonbadword
if ($msg =~ m/($w)/ixsm) {
given ($a) {
when ('kick') {
kick($svr, $ex[2], $src{nick}, 'Foul language is prohibited here.');
kick($src->{svr}, $chan, $src->{nick}, 'Foul language is prohibited here.');
}
when ('kickban') {
cmode($svr, $ex[2], '+b *!*@'.$src{host});
kick($svr, $ex[2], $src{nick}, 'Foul language is prohibited here.');
cmode($src->{svr}, $chan, '+b *!*@'.$src->{host});
kick($src->{svr}, $chan, $src->{nick}, 'Foul language is prohibited here.');
}
when ('quiet') {
cmode($svr, $ex[2], '+q *!*@'.$src{host});
cmode($src->{svr}, $chan, '+q *!*@'.$src->{host});
}
default {
kick($svr, $ex[2], $src{nick}, 'Foul language is prohibited here.');
kick($src->{svr}, $chan, $src->{nick}, 'Foul language is prohibited here.');
}
}
}
@@ -72,7 +70,7 @@ sub actonbadword
}
API::Std::mod_init("Badwords", "Xelhua", "1.00", "3.0.0d", __PACKAGE__);
API::Std::mod_init('Badwords', 'Xelhua', '1.00', '3.0.0d', __PACKAGE__);
# vim: set ai sw=4 ts=4:
# build: perl=5.010000