}
-
-
-## http://poe.perl.org/?POE_Cookbook/IRC_Bot_Debugging
-## http://poe.perl.org/?POE_Cookbook/IRC_Bot_Disconnecting
-## http://poe.perl.org/?POE_Cookbook/IRC_Bot_Reconnecting
-## http://poe.perl.org/?POE_Cookbook
-## http://poe.perl.org/?Tutorials
-## http://poe.perl.org/?POE_Support_Resources
-## http://www.mirc.net/raws/
-
-# we registered for all events, this will produce some debug info.
-sub _default {
-
-#foreach my $tmp (@_) {
-# print "_default: $tmp\n";
-#}
-#exit();
-
- my ($sender, $event, $args) = @_[SENDER, ARG0 .. $#_];
- my @output = ( "$event: " );
-
-##print "sender:\n" . Dumper($sender) . "\n";
-#print "class: " . $sender . "\n";
-#print "event: " . $event . "\n";
-#exit();
-
-if (substr($event, 0, 1) eq '_') {
- return;
-}
-
- my $irc = $sender->get_heap();
- my $session = find_irc_session($irc);
-
- set_session_activity($session);
-
-
- for my $arg (@$args) {
- if ( ref($arg) eq 'ARRAY' ) {
- push( @output, '[' . join(', ', @$arg ) . ']' );
- } elsif ( ref($arg) eq 'HASH' ) {
- push( @output, '[' . '(hash)' . ']' );
- } else {
- push ( @output, "'$arg'" );
- }
- }
- my $output = join(' ', @output);
-
-
-
- my $print_it = 1;
- if ($event eq "autoping") {
- $print_it = 0;
- }
- if ($event eq "irc_ping") {
- $print_it = 0;
- }
- if ($event eq "irc_connected") {
- $print_it = 0;
- }
- if ($event eq "irc_snotice") {
- $print_it = 0;
- }
- if ($event eq "irc_whois") {
- $print_it = 0;
- }
- if ($event eq "irc_mode") {
- $print_it = 0;
- }
- if ($event eq "irc_topic") {
- $print_it = 0;
- }
- if ($event eq "irc_ctcp_action") {
- $print_it = 0;
- }
- if ($event eq "irc_notice") {
- if (@$args[0] =~ /^NickServ/) {
- $print_it = 0;
- }
- if (@$args[0] =~ /^ChanServ/) {
- $print_it = 0;
- }
- }
- if ($event eq "irc_ctcp_version") {
- if (@$args[0] =~ /^freenode\-connect/) {
- $print_it = 0;
- }
- }
- if ($event =~ /^irc_\d+/) {
- $print_it = 0;
- }
- $print_it = 1;
-
-
-
- if ($main::debug_traffic == 1) {
- print $output . "\n";
- }
- if ($print_it == 1) {
- print_msg($output, DEBUG);
- }
-
- send_to_commandchannel($output);
-
-
- # don't handle signals
- return 0;
-}
-
-
# on_nickused()
#
# called if the desired nick is already in use
}
+## http://poe.perl.org/?POE_Cookbook/IRC_Bot_Debugging
+## http://poe.perl.org/?POE_Cookbook/IRC_Bot_Disconnecting
+## http://poe.perl.org/?POE_Cookbook/IRC_Bot_Reconnecting
+## http://poe.perl.org/?POE_Cookbook
+## http://poe.perl.org/?Tutorials
+## http://poe.perl.org/?POE_Support_Resources
+## http://www.mirc.net/raws/
+
+# we registered for all events, this will produce some debug info.
+sub _default {
+
+#foreach my $tmp (@_) {
+# print "_default: $tmp\n";
+#}
+#exit();
+
+ my ($sender, $event, $args) = @_[SENDER, ARG0 .. $#_];
+ my @output = ( "$event: " );
+
+##print "sender:\n" . Dumper($sender) . "\n";
+#print "class: " . $sender . "\n";
+#print "event: " . $event . "\n";
+#exit();
+
+if (substr($event, 0, 1) eq '_') {
+ return;
+}
+
+ my $irc = $sender->get_heap();
+ my $session = find_irc_session($irc);
+
+ set_session_activity($session);
+
+
+ for my $arg (@$args) {
+ if ( ref($arg) eq 'ARRAY' ) {
+ push( @output, '[' . join(', ', @$arg ) . ']' );
+ } elsif ( ref($arg) eq 'HASH' ) {
+ push( @output, '[' . '(hash)' . ']' );
+ } else {
+ push ( @output, "'$arg'" );
+ }
+ }
+ my $output = join(' ', @output);
+
+
+ my $print_it = 1;
+ if ($event eq "autoping") {
+ $print_it = 0;
+ }
+ if ($event eq "irc_ping") {
+ $print_it = 0;
+ }
+ if ($event eq "irc_pong") {
+ $print_it = 0;
+ }
+ if ($event eq "irc_connected") {
+ $print_it = 0;
+ }
+ if ($event eq "irc_snotice") {
+ $print_it = 0;
+ }
+ if ($event eq "irc_whois") {
+ $print_it = 0;
+ }
+ if ($event eq "irc_mode") {
+ $print_it = 0;
+ }
+ if ($event eq "irc_topic") {
+ $print_it = 0;
+ }
+ if ($event eq "irc_ctcp_action") {
+ $print_it = 0;
+ }
+ if ($event eq "irc_ctcp") {
+ $print_it = 0;
+ }
+ if ($event eq "irc_raw") {
+ $print_it = 0;
+ }
+ if ($event eq "irc_raw_out") {
+ $print_it = 0;
+ }
+ if ($event eq "irc_isupport") {
+ $print_it = 0;
+ }
+ if ($event eq "irc_notice") {
+ if (@$args[0] =~ /^NickServ/) {
+ $print_it = 0;
+ }
+ if (@$args[0] =~ /^ChanServ/) {
+ $print_it = 0;
+ }
+ if (@$args[0] =~ /\.freenode\.net/i) {
+ $print_it = 0;
+ }
+ }
+ if ($event eq "irc_ctcp_version") {
+ if (@$args[0] =~ /^freenode\-connect/) {
+ $print_it = 0;
+ }
+ }
+ if ($event =~ /^irc_\d+/) {
+ $print_it = 0;
+ }
+ #$print_it = 1;
+
+
+ if ($main::debug_traffic == 1) {
+ print $output . "\n";
+ }
+ if ($print_it == 1) {
+ print_msg($output, DEBUG);
+ send_to_commandchannel($output);
+ }
+
+ # don't handle POE signals
+ return 0;
+}