# -*- mode: perl; coding: utf-8 -*-
# keitairc/lib/plugins/00topic
# トピック一覧

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

$plugin = {
	name => 'topic',
	action_imprementation => sub {
		my ($request, $name, $session_id, $param) = @_;
		my @loop;
		for my $cid ($::ib->channels()){
			my $p = {};
			$p->{cid} = $cid;
			$p->{cname} = $::ib->simple_escape($::ib->compact_channel_name($cid));
			$p->{topic} = $::ib->simple_escape($::ib->topic($cid));
			push @loop, $p;
		}

		my $ci = new Keitairc::ClientInfo($request);
		my $view = new Keitairc::View($::cf, $ci);
		return $view->render('topic.html', { loop => \@loop });
	}
};

1;
