# -*- mode: perl; coding: utf-8 -*-
# keitairc/lib/plugins/00nick
# nick一覧

# The line number (1 incremented) and filename below must be
# actual. see perlsyn.
# line 10 "keitairc/lib/plugins/00nick"

$plugin = {
	name => 'nick',
	action_imprementation => sub {
		my ($request, $name, $session_id, $param_string) = @_;
		my $cid = $param_string;
		my $channel = $::ib->cid2name($cid);
		my @loop;
		for my $nick (sort $::ib->list_nick($cid)){
			my $p = {};
			$p->{nick} = $nick;
			$p->{op} = $::ib->get_nick_op($cid, $nick);
			$p->{realname} = $::ib->get_nick_realname($cid, $nick);
			push @loop, $p;
		}
		my $ci = new Keitairc::ClientInfo($request);
		my $view = new Keitairc::View($::cf, $ci);
		return $view->render('nick.html', {
			channel_compact => $::ib->simple_escape($::ib->compact_channel_name($cid)),
			loop => \@loop,
			cid => $cid
			     });
	}
};

1;
