mirror of
https://github.com/irssi/irssi.git
synced 2024-09-08 04:26:01 -04:00
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@776 dbcabf3a-b0e7-0310-adc4-f8d773084564
27 lines
503 B
Perl
27 lines
503 B
Perl
# /CLONES - display real name of nick
|
|
|
|
use Irssi;
|
|
use Irssi::Irc;
|
|
|
|
sub cmd_clones {
|
|
my ($data, $server, $channel) = @_;
|
|
my %hostnames, $host, @nicks, $nick;
|
|
|
|
@nicks = $channel->nicklist_getnicks();
|
|
|
|
foreach $nick (@nicks) {
|
|
$hostnames{$nick->values()->{'host'}}++;
|
|
}
|
|
|
|
$channel->print("Clones:");
|
|
foreach $host (keys %hostnames) {
|
|
my $clones = $hostnames{$host};
|
|
if ($clones >= 2) {
|
|
$channel->print("$host: $clones");
|
|
}
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
Irssi::command_bind('clones', '', 'cmd_clones');
|