Changeset 19333
- Timestamp:
- 09/15/08 20:35:36 (5 years ago)
- Location:
- lang/perl/Morris/trunk
- Files:
-
- 3 added
- 5 modified
-
eg/morris.conf.example.conf (modified) (1 diff)
-
lib/Morris.pm (modified) (1 diff)
-
lib/Morris/Plugin/Channel/Join.pm (modified) (1 diff)
-
lib/Morris/Plugin/Channel/Log (added)
-
lib/Morris/Plugin/Channel/Log.pm (modified) (2 diffs)
-
lib/Morris/Plugin/Channel/Log/File.pm (added)
-
lib/Morris/Plugin/Channel/Log/Handle.pm (added)
-
lib/Morris/Plugin/Reply/Templated.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/Morris/trunk/eg/morris.conf.example.conf
r19289 r19333 20 20 21 21 # Takes logs for a channel, and puts it in a file 22 # Unimplemented yet.23 22 <Plugin Channel::Log::File> 24 Channel \# endeworks23 Channel \#channelname 25 24 Directory /path/to/directory 26 25 </Plugin> -
lang/perl/Morris/trunk/lib/Morris.pm
r19289 r19333 2 2 3 3 package Morris; 4 use 5.008; 4 5 5 6 our $AUTHORITY = 'cpan:DMAKI'; -
lang/perl/Morris/trunk/lib/Morris/Plugin/Channel/Join.pm
r19289 r19333 38 38 sub join_channels { 39 39 my $self = shift; 40 $self->connection->irc_join( { channels => $self->channels} );40 $self->connection->irc_join( { channels => [ $self->channels ] } ); 41 41 } 42 42 -
lang/perl/Morris/trunk/lib/Morris/Plugin/Channel/Log.pm
r19289 r19333 2 2 3 3 package Morris::Plugin::Channel::Log; 4 use Moose ;4 use Moose::Role; 5 5 6 6 with 'Morris::Plugin'; … … 12 12 ); 13 13 14 __PACKAGE__->meta->make_immutable;14 requires 'log_message'; 15 15 16 no Moose ;16 no Moose::Role; 17 17 18 18 sub register { 19 19 my ($self, $conn) = @_; 20 $conn->register_hook( 'channel.public', sub { $self-> log_message(@_) } );20 $conn->register_hook( 'channel.public', sub { $self->handle_message(@_) } ); 21 21 } 22 22 23 sub log_message {23 sub handle_message { 24 24 my ($self, $args) = @_; 25 25 26 26 my $message = $args->{message}; 27 27 28 # make sure this is from the correct channel 28 29 29 if ($message->channel eq $self->channel) { 30 print "incoming ", $message->message, "\n";30 $self->log_message($args); 31 31 } 32 32 } -
lang/perl/Morris/trunk/lib/Morris/Plugin/Reply/Templated.pm
r19289 r19333 1 1 # $Id$ 2 3 1; 2 4 3 5 __END__
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)