source: server/trunk/web/lib/Sophie/Controller/Chat.pm @ 36

Last change on this file since 36 was 36, checked in by nanardon, 14 years ago
  • propery call fetchdata

command line parsing is done by the Model

File size: 1.1 KB
Line 
1package Sophie::Controller::Chat;
2use Moose;
3use namespace::autoclean;
4
5BEGIN {extends 'Catalyst::Controller'; }
6
7=head1 NAME
8
9Sophie::Controller::Chat - Catalyst Controller
10
11=head1 DESCRIPTION
12
13Catalyst Controller.
14
15=head1 METHODS
16
17=cut
18
19
20=head2 index
21
22=cut
23
24sub index :Path :Args(0) {
25    my ( $self, $c ) = @_;
26
27
28}
29
30
31sub message : XMLRPC {
32    my ($self, $c, $contexts, $message) = @_;
33   
34    my $reqspec = {};
35
36    foreach my $co (ref $contexts ? @$contexts : $contexts) {
37        if (ref($co) eq 'HASH') {
38            foreach (keys %$co) {
39                $reqspec->{$_} = $co->{$_};
40            }
41        } else {
42            if (my $coo = $c->forward('/user/fetchdata', [ $co ])) {
43                foreach (keys %$coo) { 
44                    $reqspec->{$_} = $coo->{$_};
45                }
46            }
47        }
48    }
49
50    $c->stash->{xmlrpc} = $c->forward($c->model('Chat'), [ $reqspec, $message ]); 
51   
52}
53
54=head1 AUTHOR
55
56Olivier Thauvin
57
58=head1 LICENSE
59
60This library is free software. You can redistribute it and/or modify
61it under the same terms as Perl itself.
62
63=cut
64
65__PACKAGE__->meta->make_immutable;
66
671;
Note: See TracBrowser for help on using the repository browser.