# -*-perl-*-
# keitairc/lib/plugins/00all
# `l̑SbZ[W{
# $Id: 00all,v 1.4 2008/02/25 15:46:31 morimoto Exp $
# $Source: /cvsroot/keitairc/lib/plugins/00all,v $

$plugin = {
	name => 'all',
	action_imprementation => sub {
		my ($request, $name, $session_id, $param_string) = @_;
		my $cid = $param_string;
		my $channel = $::ib->cid2name($cid);

		::send_message($request, $channel);

		my $buf;
		if(defined($::ib->cid2name($cid))){
			if(length($::ib->buffer($cid))){
				$buf = ::render_line($::ib->buffer($cid), $session_id);
			}
		}

		$::ib->message_added(0); # clear check flags
		$::ib->clear_unread($cid);

		my $ci = new Keitairc::ClientInfo($request);
		my $view = new Keitairc::View($::cf, $ci);

		my $p;
		$p->{buf} = $buf;
		$p->{channel_compact} = $::ib->compact_channel_name($cid);
		$p->{cid} = $cid;
		return $view->render('all.html', $p);
	}
};

1;
