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
/
user
/
ignore.plm
< prev
Wrap
Text File
|
1999-02-20
|
3KB
|
132 lines
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><!-- $_ if 0; # -*- perl -*-
# $Id: ignore.plm,v 2.11 1999/01/28 12:19:48 hasegawa Exp $
# copyright (c)1997-1999 Yoshinori Hasegawa <hasegawa@madoka.org>
package user_ignore;
$COMMAND = &'list('privmsg', 'notice');
$_ = 'user_ignore';
sub ss_privmsg {
local($serverno, $prefix, $cmd, @params) = @_;
local($userno, $regex);
$userno = $'userno[$serverno];
if (&maskcommand($userno, $cmd)) {
if (&check_mask($userno, $prefix, $params[0])) {
return ();
}
}
return ($prefix, $cmd, @params);
}
sub ss_notice {
local($serverno, $prefix, $cmd, @params) = @_;
local($userno, $regex);
$userno = $'userno[$serverno];
if (&maskcommand($userno, $cmd)) {
if (&check_mask($userno, $prefix, $params[0])) {
return ();
}
}
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;
}
sub maskcommand {
local($userno, $cmd) = @_;
local($mask);
$mask = &'property($userno, 'command');
if (defined($mask)) {
$mask = '';
foreach $list (&'property($userno, 'command')) {
$mask = &'add($mask, split(/\,/, $list));
}
} else {
$mask = $COMMAND;
}
return &'exist($mask, $cmd);
}
__END__
--><HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-2022-JP">
<LINK REV="made" HREF="mailto:hasegawa@madoka.org">
<TITLE>user/ignore.plm</TITLE></HEAD><BODY>
$B%*%s%i%$%s%I%-%e%a%s%H(B
<HR><H3>$BL>A0(B</H3>
user/ignore.plm - $B;XDj$7$?%f!<%6$NH/8@$rL5;k$9$k(B
<HR><H3>$B@bL@(B</H3>
$B;XDj$7$?%f!<%6$NH/8@$r%/%i%$%"%s%H$KAw$i$J$$$h$&$K$7$^$9!#(B
<HR><H3>$B%W%m%Q%F%#(B</H3>
<DL>
<DT> user.ignore.mask* $B%f!<%6%^%9%/(B [($B%A%c%s%M%kL>(B)]
</DT>
<DD> $BH/8@$7$??M$,$3$3$G;XDj$7$?$b$N$K%^%C%A$7$?>l9g!"(B
$B$=$N?M$NH/8@$rL5;k$7!"%/%i%$%"%s%H$KAw$i$J$$$h$&$K$7$^$9!#(B
</DD>
<DT> user.ignore.command* ({privmsg|notice})
</DT>
<DD> $BL5;k$9$k%a%C%;!<%8$N<oN`$r;XDj$7$^$9!#(B
$B%G%U%)%k%H$G$O(BPRIVMSG$B$H(BNOTICE$B$NN>J}$rL5;k$7$^$9!#(B
</DD>
</DL>
<HR><H3>$B@_DjNc(B</H3>
<PRE>
+ user/ignore.plm
user.ignore.mask: -*!*@*.jp
user.ignore.mask: *!*@*
</PRE>
$B!V(B*!*@*.jp$B!W$K%^%C%A$7$J$$?M$NH/8@$r$9$Y$FL5;k$7$^$9!#(B
<PRE>
+ user/ignore.plm
user.ignore.mask: dummy!*@*
user.ignore.command: privmsg
</PRE>
$B!V(Bdummy$B!W$H$$$&%K%C%/%M!<%`$N%f!<%6$N!"(BPRIVMSG$B$G$NH/8@$rL5;k$7$^$9!#(B
</BODY></HTML>