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
/
nick
/
client.plm
Wrap
Text File
|
1999-02-20
|
4KB
|
136 lines
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><!-- $_ if 0; # -*- perl -*-
# $Id: client.plm,v 2.11 1998/12/20 02:17:13 hasegawa Exp $
# copyright (c)1997-1998 Yoshinori Hasegawa <hasegawa@madoka.org>
package user_nick_client;
$_ = 'user_nick_client';
sub client_open {
local($clientno) = @_;
local($userno, $sno);
$userno = $'userno[$clientno];
$sno = $'server[$clientno];
return unless ($sno && $'avail[$sno]);
foreach $cno (&'array($'clientlist)) {
next unless $'avail[$cno];
return if $'server[$cno] == $sno && $cno != $clientno;
}
$nicklist[$sno] = '';
foreach $list (&'property($userno, 'stay')) {
$nicklist[$sno] = &'add($nicklist[$sno], split(/\,/, $list));
}
return unless $nicklist[$sno];
&'s_print($sno, '', 'NICK', (&'array($nicklist[$sno]))[0]);
$flag[$sno] = 1;
}
sub client_close {
local($clientno) = @_;
local($userno, $sno);
$userno = $'userno[$clientno];
$sno = $'server[$clientno];
return unless ($sno && $'avail[$sno]);
foreach $cno (&'array($'clientlist)) {
next unless $'avail[$cno];
return if $'server[$cno] == $sno;
}
$nicklist[$sno] = '';
foreach $list (&'property($userno, 'away')) {
$nicklist[$sno] = &'add($nicklist[$sno], split(/\,/, $list));
}
return unless $nicklist[$sno];
&'s_print($sno, '', 'NICK', (&'array($nicklist[$sno]))[0]);
$flag[$sno] = 1;
}
sub ss_nick {
local($serverno, $prefix, $cmd, @params) = @_;
$nick = &'prefix($prefix);
$flag[$serverno] = 0 if $params[0] eq $'nick[$serverno];
return ($prefix, $cmd, @params);
}
sub ss_433 {
local($serverno, $prefix, $cmd, @params) = @_;
&anothernick($serverno, $params[0], $params[1]) if $flag[$serverno];
return ($prefix, $cmd, @params);
}
sub ss_437 {
local($serverno, $prefix, $cmd, @params) = @_;
&anothernick($serverno, $params[0], $params[1]) if $flag[$serverno];
return ($prefix, $cmd, @params);
}
sub anothernick {
local($serverno, $nick, $newnick) = @_;
local($userno, @nickentry);
return if $nick ne $'nick[$serverno];
$userno = $'userno[$serverno];
@nickentry = &'array($nicklist[$serverno]);
return if $nickentry[$#nickentry] eq $newnick;
if (&'exist($nicklist[$serverno], $newnick)) {
while ($nickentry[0] ne $newnick) {
push(@nickentry, shift(@nickentry));
}
push(@nickentry, shift(@nickentry));
}
&'s_print($serverno, '', 'NICK', $nickentry[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>user/nick/client.plm</TITLE></HEAD><BODY>
$B%*%s%i%$%s%I%-%e%a%s%H(B
<HR><H3>$BL>A0(B</H3>
user/nick/client.plm - $B%/%i%$%"%s%H$H$N@\B3>uBV$K$h$C$F%K%C%/%M!<%`$rJQ99$9$k(B
<HR><H3>$B@bL@(B</H3>
plum$B$K%/%i%$%"%s%H$,@\B3$5$l$F$$$k$+$I$&$+$K$h$C$F!"(B
$B%K%C%/%M!<%`$rJQ99$7$^$9!#(B
<HR><H3>$B%W%m%Q%F%#(B</H3>
<DL>
<DT> user.nick.client.stay* ($B%K%C%/%M!<%`(B)
</DT>
<DD> $B%/%i%$%"%s%H$,@\B3$5$l$F$$$k$H$-$N%K%C%/%M!<%`$r;XDj$7$^$9!#(B
$B;XDj$7$?%K%C%/%M!<%`$,$9$G$K;H$o$l$F$$$F!"(B
$B$=$N%K%C%/%M!<%`$KJQ99$G$-$J$$$H$-$O!"(B
$B:G=i$K;XDj$7$?$b$N$+$i=gHV$KJQ99$7$^$9!#(B
</DD>
<DT> user.nick.client.away* ($B%K%C%/%M!<%`(B)
</DT>
<DD> $B%/%i%$%"%s%H$,@\B3$5$l$F$$$J$$$H$-$N%K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