home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.madoka.org
/
2014.12.ftp.madoka.org.tar
/
ftp.madoka.org
/
pub
/
plum
/
2.x
/
plum2_32_1.lzh
/
module
/
channel
/
join
/
kick.plm
< prev
Wrap
Text File
|
1999-02-20
|
3KB
|
117 lines
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><!-- $_ if 0; # -*- perl -*-
# $Id: kick.plm,v 2.15 1999/01/28 12:18:51 hasegawa Exp $
# copyright (c)1997-1999 Yoshinori Hasegawa <hasegawa@madoka.org>
package channel_join_kick;
$_ = 'channel_join_kick';
sub server_close {
local($serverno) = @_;
local($no, $chan);
foreach $key (keys(%keyword)) {
($no, $chan) = split(/$;/, $key, 2);
next unless $no == $serverno;
delete $keyword{$key};
}
}
sub sp_join {
local($serverno, $prefix, $cmd, @params) = @_;
local(@chan, @key, $i);
if ($params[1]) {
if (!&'exist($'channellist{$serverno}, $params[0])) {
@chan = split(/\,/, $params[0]);
@key = split(/\,/, $params[1]);
for ($i = 0; $i < @chan; $i++) {
$keyword{$serverno, $chan[$i]} = $key[$i];
}
}
}
return ($prefix, $cmd, @params);
}
sub ss_kick {
local($serverno, $prefix, $cmd, @params) = @_;
local($userno, $regex);
$userno = $'userno[$serverno];
if ($params[1] eq $'nick[$serverno]) {
if (&check_mask($userno, $prefix, $params[0])) {
&'s_print($serverno, '', 'JOIN', $params[0], $'channelmode{$serverno, $params[0], 'k'} || $keyword{$serverno, $params[0]} || '');
}
}
return ($prefix, $cmd, @params);
}
sub check_mask {
local($userno, $prefix, $chan) = @_;
local($user, $chlist, $list);
foreach $mask (&'property($userno, 'mask')) {
($user, $chlist) = split(/\s+/, $mask);
$list = '';
foreach $vchan (split(/\,/, $chlist || '')) {
$list = &'add($list, &'real($vchan));
}
if (&'channel($chan)) {
next unless (!$list || &'exist($list, $chan));
} else {
next unless (!$list || &'exist($list, '*'));
}
if ($user =~ /^\-/) {
$regex = &'regex(substr($user, 1));
return 0 if $prefix =~ /$regex/i;
}
if ($user =~ /^\+/) {
$regex = &'regex(substr($user, 1));
} else {
$regex = &'regex($user);
}
return 1 if $prefix =~ /$regex/i;
}
return 0;
}
__END__
--><HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-2022-JP">
<LINK REV="made" HREF="mailto:hasegawa@madoka.org">
<TITLE>channel/join/kick.plm</TITLE></HEAD><BODY>
$B%*%s%i%$%s%I%-%e%a%s%H(B
<HR><H3>$BL>A0(B</H3>
channel/join/kick.plm - $B%A%c%s%M%k$+$i%-%C%/$5$l$F$bF~$jD>$9(B
<HR><H3>$B@bL@(B</H3>
$B%A%c%s%M%k$+$i%-%C%/$5$l$?$H$-$K!":F$S$=$N%A%c%s%M%k$KF~$j$^$9!#(B
<HR><H3>$B%W%m%Q%F%#(B</H3>
<DL>
<DT> channel.join.kick.mask* $B%f!<%6%^%9%/(B [($B%A%c%s%M%kL>(B)]
</DT>
<DD> $B%-%C%/$7$??M$,$3$3$G;XDj$7$?$b$N$K%^%C%A$7$?$i!"(B
$B%-%C%/$5$l$?%A%c%s%M%k$K:F$SF~$j$^$9!#(B
</DD>
</DL>
<HR><H3>$B@_DjNc(B</H3>
<PRE>
+ channel/join/kick.plm
channel.join.kick.mask: -*!*@* #$B$^$I$+(B:*.jp
channel.join.kick.mask: *!*@*
</PRE>
$B!V(B#$B$^$I$+(B:*.jp$B!W$+$i%-%C%/$5$l$?$H$-$O2?$b$7$^$;$s$,!"(B
$B$=$l0J30$N%A%c%s%M%k$+$i%-%C%/$5$l$?$H$-$O$=$N%A%c%s%M%k$K(B
$B:F$SF~$j$^$9!#(B
</BODY></HTML>