X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FPOE%2FComponent%2FIRC%2FPlugin%2FSeen.pm;h=90a13a61be37da4766b43936ca71db13a1cddf0d;hb=5f2b55bea0b0f92bc73fcef46336ee2b64097e8d;hp=cc2f76defd9488cabf7938e0423cbc921ad714b6;hpb=3b40dfa4a2dcb643aadafffdff3410b95a695417;p=poe-component-irc-plugin-seen.git diff --git a/lib/POE/Component/IRC/Plugin/Seen.pm b/lib/POE/Component/IRC/Plugin/Seen.pm index cc2f76d..90a13a6 100644 --- a/lib/POE/Component/IRC/Plugin/Seen.pm +++ b/lib/POE/Component/IRC/Plugin/Seen.pm @@ -83,7 +83,7 @@ sub S_msg { my ($self, $irc, $rfullname, $rtargets, $rmessage) = @_; my $nick = parse_user $$rfullname; - seen $self, $irc, $$rmessage, $$rtargets->[0], $nick if $$rmessage =~ /^\s*!?seen\s+([^ ]+)/ + seen $self, $irc, $1, $$rtargets->[0], $nick if $$rmessage =~ /^\s*!?seen\s+([^ ]+)/ } 1; @@ -100,11 +100,21 @@ POE::Component::IRC::Plugin::Seen - PoCo-IRC plugin that remembers seeing people my $irc = POE::Component::IRC->spawn; $irc->plugin_add(Seen => POE::Component::IRC::Plugin::Seen->new(filename => 'mycache.db')); + # In chat + # Hi there! + # !seen mgv + # I last saw mgv [DATE] on channel #whatever saying Hi there! + =head1 DESCRIPTION -POE::Component::IRC::Plugin::Seen is a PoCo-IRC plugin that remembers what each person around it did last. +POE::Component::IRC::Plugin::Seen is a PoCo-IRC plugin that remembers +what each person around it did last. It remembers public messages, +joins and parts. -When somebody sends him a private message of the form 'seen NICKNAME' or somebody says 'botnick: seen NICKNAME' in a channel with the bot, the plugin answers with the last action NICKNAME did. +When somebody sends him a private message of the form 'seen NICKNAME' +or somebody says 'seen NICKNAME' or 'botnick: seen NICKNAME' in a +channel with the bot, the plugin answers with the last action NICKNAME +did. There can be an exclamation mark before the word 'seen'. =head1 METHODS @@ -112,9 +122,12 @@ When somebody sends him a private message of the form 'seen NICKNAME' or somebod =item B([I => value]) -Creates a new plugin object suitable for L's C method. +Creates a new plugin object suitable for L's +C method. -Takes one optional argument, C, the name of the file to store the plugin's state in. If C or not given, it keeps the state in memory. +Takes one optional argument, C, the name of the file to +store the plugin's state in. If C or not given, it keeps the +state in memory. =back @@ -128,7 +141,7 @@ Marius Gavrilescu C<< >> =head1 COPYRIGHT AND LICENSE -Copyright (C) 2013,2014 by Marius Gavrilescu +Copyright (C) 2013-2015 by Marius Gavrilescu This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.2 or,