Updated to obey updated API.
This commit is contained in:
1 parent
60cdd488ba
commit
f97b55a56c
2 files changed
+14
-17
No files matched your search
+4
-5
@@ -12,15 +12,14 @@ our (%usercmd);
|
|||||||
|
|
||||||
# CTCP VERSION reply.
|
# CTCP VERSION reply.
|
||||||
hook_add("on_uprivmsg", "ctcp_version_reply", sub {
|
hook_add("on_uprivmsg", "ctcp_version_reply", sub {
|
||||||
my (($svr, @ex)) = @_;
|
my (($src, @msg)) = @_;
|
||||||
my %src = usrc(substr($ex[0], 1));
|
|
||||||
|
|
||||||
if ($ex[3] eq ":\001VERSION\001") {
|
if ($msg[0] eq "\001VERSION\001") {
|
||||||
if (Auto::RSTAGE ne 'd') {
|
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 {
|
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
@@ -36,14 +36,12 @@ sub _void
|
|||||||
# Callback for act_on_badword hook.
|
# Callback for act_on_badword hook.
|
||||||
sub actonbadword
|
sub actonbadword
|
||||||
{
|
{
|
||||||
my (($svr, @ex)) = @_;
|
my (($src, $chan, @msg)) = @_;
|
||||||
my %src = API::IRC::usrc(substr $ex[0], 1);
|
|
||||||
|
|
||||||
my $msg = substr $ex[3], 1;
|
my $msg = join ' ', @msg;
|
||||||
for (my $i = 4; $i < scalar @ex; $i++) { $msg .= q{ }.$ex[$i]; }
|
|
||||||
|
|
||||||
if (conf_get("badwords:$ex[2]:word")) {
|
if (conf_get("badwords:$chan:word")) {
|
||||||
my @words = @{ (conf_get("badwords:$ex[2]:word"))[0] };
|
my @words = @{ (conf_get("badwords:$chan:word"))[0] };
|
||||||
|
|
||||||
foreach (@words) {
|
foreach (@words) {
|
||||||
my ($w, $a) = split m/[:]/, $_;
|
my ($w, $a) = split m/[:]/, $_;
|
||||||
@@ -51,17 +49,17 @@ sub actonbadword
|
|||||||
if ($msg =~ m/($w)/ixsm) {
|
if ($msg =~ m/($w)/ixsm) {
|
||||||
given ($a) {
|
given ($a) {
|
||||||
when ('kick') {
|
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') {
|
when ('kickban') {
|
||||||
cmode($svr, $ex[2], '+b *!*@'.$src{host});
|
cmode($src->{svr}, $chan, '+b *!*@'.$src->{host});
|
||||||
kick($svr, $ex[2], $src{nick}, 'Foul language is prohibited here.');
|
kick($src->{svr}, $chan, $src->{nick}, 'Foul language is prohibited here.');
|
||||||
}
|
}
|
||||||
when ('quiet') {
|
when ('quiet') {
|
||||||
cmode($svr, $ex[2], '+q *!*@'.$src{host});
|
cmode($src->{svr}, $chan, '+q *!*@'.$src->{host});
|
||||||
}
|
}
|
||||||
default {
|
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:
|
# vim: set ai sw=4 ts=4:
|
||||||
# build: perl=5.010000
|
# build: perl=5.010000
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user