home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.madoka.org
/
2014.12.ftp.madoka.org.tar
/
ftp.madoka.org
/
pub
/
plum
/
1.x
/
plum12.lzh
/
plum12
/
autoaway.plm
next >
Wrap
Text File
|
1997-09-25
|
648b
|
30 lines
package autoaway;
$_ = 'autoaway';
sub server_open {
local($serverno) = @_;
local($away);
$away = &getaway($'userno[$serverno], $'nick[$serverno]);
&'s_print($serverno, '', 'AWAY', $away) if $away;
}
sub ss_nick {
local($serverno, $prefix, $cmd, $nick) = @_;
if ($nick eq $'nick[$serverno]) {
&'s_print($serverno, '', 'AWAY', &getaway($'userno[$serverno], $nick));
}
return ($prefix, $cmd, $nick);
}
sub getaway {
local($userno, $nick) = @_;
local($name, $away);
foreach $nickname (&'property($userno, 'nick')) {
($name, $away) = split(/\s+/, $nickname, 2);
return $away if $name eq $nick;
}
return '';
}