Changeset 12990 for lang

Show
Ignore:
Timestamp:
06/01/08 20:08:58 (7 years ago)
Author:
tokuhirom
Message:

fixed a lot of bugs

Location:
lang/perl/mobirc/branches/plaggerize
Files:
1 added
8 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/mobirc/branches/plaggerize/CONCEPT

    r12977 r12990  
    2020-- HTTPD::* => Web::* 
    2121-- hirose31's Groups => Hook. 
     22-- validate_hook を、もうちょいなんとかかっこよく実装したい。 
     23 
  • lang/perl/mobirc/branches/plaggerize/lib/App/Mobirc/HTTPD/C.pm

    r12910 r12990  
    3939    $c->res->body( $content ); 
    4040 
    41     context->run_hook('response_filter'); 
     41    context->run_hook('response_filter', $c); 
    4242} 
    4343 
  • lang/perl/mobirc/branches/plaggerize/lib/App/Mobirc/HTTPD/C/Mobile.pm

    r12910 r12990  
    122122            recent_mode         => $c->req->params->{recent_mode}, 
    123123            message             => $c->req->params->{'msg'} || '', 
    124             channel_page_option => [ 
    125                 context->run_hook('channel_page_option', $channel, $c) 
    126             ], 
     124            channel_page_option => context->run_hook('channel_page_option', $channel, $c), 
    127125            irc_nick            => irc_nick, 
    128126        } 
  • lang/perl/mobirc/branches/plaggerize/lib/App/Mobirc/HTTPD/Handler.pm

    r12910 r12990  
    1717    my $c = shift; 
    1818 
    19     context->run_hook('request_filter'); 
     19    context->run_hook('request_filter', $c); 
    2020 
    2121    if (authorize($c)) { 
     
    2424            $c->res->set_http_response($response); 
    2525        } 
    26         context->run_hook('response_filter'); 
     26        context->run_hook('response_filter', $c); 
    2727    } else { 
    2828        $c->res->status(401); 
  • lang/perl/mobirc/branches/plaggerize/lib/App/Mobirc/Plugin/Authorizer/Cookie.pm

    r12975 r12990  
    77use Digest::MD5 (); 
    88use Encode; 
     9use App::Mobirc::Validator; 
    910 
    1011has password => ( 
     
    2122 
    2223hook authorize => sub { 
    23     my ( $self, $global_context, $c, ) = @_; 
     24    my ( $self, $global_context, $c, ) = validate_hook('authorize', @_); 
    2425 
    2526    my $cookie_str = $c->req->header('Cookie'); 
     
    4142 
    4243hook response_filter => sub { 
    43     my ($self, $global_context, $c) = @_; 
     44    my ($self, $global_context, $c) = validate_hook('response_filter', @_); 
    4445 
    4546    $c->res->cookies->{mobirc_key} = CGI::Cookie->new( 
  • lang/perl/mobirc/branches/plaggerize/lib/App/Mobirc/Plugin/DocRoot.pm

    r12977 r12990  
    55use XML::LibXML; 
    66use Encode; 
     7use Params::Validate ':all'; 
    78 
    89has root => ( 
     
    1314 
    1415hook request_filter => sub { 
    15     my ($self, $global_context, $c) = @_; 
     16    my ($self, $global_context, $c) = validate_pos(@_, 
     17        { isa => __PACKAGE__ }, 
     18        { isa => 'App::Mobirc' }, 
     19        { isa => 'HTTP::Engine::Context' }, 
     20    ); 
    1621 
    1722    my $root = $self->root; 
  • lang/perl/mobirc/branches/plaggerize/lib/App/Mobirc/Plugin/HTMLFilter/ConvertPictograms.pm

    r12977 r12990  
    33use MooseX::Plaggerize::Plugin; 
    44use HTML::Entities::ConvertPictogramMobileJp qw(convert_pictogram_entities); 
     5use Params::Validate ':all'; 
    56 
    67hook html_filter => sub { 
    7     my ( $self, $global_context, $c, $content ) = @_; 
     8    my ($self, $global_context, $c, $content) = validate_pos(@_, 
     9        { isa => __PACKAGE__ }, 
     10        { isa => 'App::Mobirc' }, 
     11        { isa => 'HTTP::Engine::Context' }, 
     12        { type => SCALAR }, 
     13    ); 
    814 
    915    return ( 
  • lang/perl/mobirc/branches/plaggerize/lib/App/Mobirc/Plugin/HTMLFilter/DoCoMoCSS.pm

    r12977 r12990  
    1313 
    1414    DEBUG "FILTER DOCOMO CSS"; 
    15     return $content unless $c->req->mobile_agent->is_docomo; 
     15    return ($c, $content) unless $c->req->mobile_agent->is_docomo; 
    1616 
    1717    # escape Numeric character reference.