From 7f0e743c93ec0ffcf20bc6de7ffb7a335523500f Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 12 Jan 2010 15:21:15 -0500 Subject: [PATCH] committing the changes for > --- lib/Bot/BB3/Roles/IRC.pm | 29 ++++++++++- need | 106 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 133 insertions(+), 2 deletions(-) create mode 100644 need diff --git a/lib/Bot/BB3/Roles/IRC.pm b/lib/Bot/BB3/Roles/IRC.pm index f89d174..1e926ef 100644 --- a/lib/Bot/BB3/Roles/IRC.pm +++ b/lib/Bot/BB3/Roles/IRC.pm @@ -287,11 +287,21 @@ sub _said { $said->{$_} = shift @user_info; } - + + #-------------------------- + # Check for forwarded message + #-------------------------- + $said->{body} = $said->{body_raw}; + + if ($said->{body} =~ s/\s*>\s*\b([^>]+)\s*$//) + { + #we have a forwarded message + $said->{forwarding} = $1; + } + #-------------------------- # Check for our own name #-------------------------- - $said->{body} = $said->{body_raw}; if( $said->{my_name} ) { #TODO verify that we need this if check. my $body = $said->{body_raw}; @@ -505,6 +515,21 @@ sub channel_list { sub plugin_output { my( $self, $said, $text ) = @_[OBJECT,ARG0,ARG1]; + #this forwards messages to priv_msg for users + if (exists($said->{forwarding}) && defined($said->{forwarding}) && ($said->{forwarding} =~ /\S/)) + { + my $copy = {%$said}; #make a shallow copy of $said + delete $copy->{forwarding}; + $copy->{channel} = "*irc_msg"; + $copy->{name} = $said->{forwarding}; + my $newtext = $said->{name} . " wanted you to know: ". $text; + $_[KERNEL]->yield(plugin_output => $copy, $newtext); + $said->{channel} = "*irc_msg"; + delete $said->{forwarding}; + $_[KERNEL]->yield(plugin_output => $said, "Told ".$copy->{name}." about ".$text); + return; + } + utf8::decode( $text ); return unless $text =~ /\S/; diff --git a/need b/need new file mode 100644 index 0000000..6777cc3 --- /dev/null +++ b/need @@ -0,0 +1,106 @@ +AutoLoader +B::Deparse +BSD::Resource +Bot::BB3 +Bot::BB3::ConfigParser +Bot::BB3::Logger +Bot::BB3::MacroQuote +Bot::BB3::PluginConfigParser +Bot::BB3::PluginManager +Bot::BB3::PluginWrapper +CGI +Carp +Carp::Heavy +Config::General +DBD::SQLite +DBI +Data::Dumper +Date::Manip +DateTime +DateTimeX::Easy +Encode +EvalServer +ExtUtils::Constant +ExtUtils::MakeMaker +File::Glob +File::Listing +Finance::Currency::Convert::XE +Geo::IATA +Geo::IP +Geo::WeatherNWS +Getopt::Long +Getopt::Std +HTML::Entities +HTML::TreeBuilder +HTTP::Status +IMDB +IO::Socket::INET +JavaScript::SpiderMonkey +LWP::Simple +LWP::UserAgent +Language::K20 +List::AllUtils +List::MoreUtils +List::Util +Log::Log4perl +Math::Farnsworth::Dimension +Math::Farnsworth::Error +Math::Farnsworth::Evaluate +Math::Farnsworth::FunctionDispatch +Math::Farnsworth::Output +Math::Farnsworth::Parser +Math::Farnsworth::Units +Math::Farnsworth::Value +Math::Farnsworth::Value::Array +Math::Farnsworth::Value::Boolean +Math::Farnsworth::Value::Date +Math::Farnsworth::Value::Lambda +Math::Farnsworth::Value::Pari +Math::Farnsworth::Value::String +Math::Farnsworth::Value::Undef +Math::Farnsworth::Variables +Math::Pari +Memoize +Module::CoreList +MyModule::Somewhere +Net::DNS +Net::FTP +POE +POE::Component::IRC::Common +POE::Component::IRC::Plugin::AutoJoin +POE::Component::IRC::Plugin::Connector +POE::Component::IRC::Plugin::NickReclaim +POE::Component::IRC::State +POE::Component::Server::SimpleHTTP +POE::Filter::Line +POE::Filter::Reference +POE::Filter::Stream +POE::Session +POE::Wheel::ReadWrite +POE::Wheel::Run +POE::Wheel::SocketFactory +POSIX +Parse::RecDescent +PerlIO +PerlIO::scalar +REST::Google::Translate +Scalar::Util +Socket +Storable +Template +Term::ANSIColor +Term::ReadLine +Test +Test::More +Text::Aspell +Text::Glob +Text::Soundex +Tie::Hash::NamedCapture +URI +URI::Escape +URI::URL +Unicode::UCD +WWW::RottenTomatoes +WWW::Shorten +Weather::Underground +XML::RSS::Parser