diff options
author | yorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b> | 2008-08-09 14:29:04 +0000 |
---|---|---|
committer | yorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b> | 2008-08-09 14:29:04 +0000 |
commit | 99214c46848b3e4706552cfb87043861c1b5f140 (patch) | |
tree | 66792509578c7738b10179fc9baaf50a2b8934c8 | |
parent | d4ba8b01125efae32a75be2777a185f95824f4d3 (diff) |
Added an optional debug console to Multi, dynamically loading Plugin::Console and NickServID only when needed, and decided to not allow PM-notifies for now
git-svn-id: svn://vndb.org/vndb@82 1fe2e327-d9db-4752-bcf7-ef0cb4a1748b
-rw-r--r-- | lib/Multi/IRC.pm | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/lib/Multi/IRC.pm b/lib/Multi/IRC.pm index c34f4def..9f3f9b21 100644 --- a/lib/Multi/IRC.pm +++ b/lib/Multi/IRC.pm @@ -12,7 +12,6 @@ use POE qw| Component::IRC::Plugin::Connector Component::IRC::Plugin::CTCP Component::IRC::Plugin::Logger - Component::IRC::Plugin::NickServID |; use POE::Component::IRC::Common ':ALL'; use URI::Escape 'uri_escape_utf8'; @@ -50,7 +49,7 @@ sub spawn { }, log => {}, privpers => {}, - notify => [], # this list should be stored on disk... + notify => [], } ); } @@ -74,10 +73,21 @@ sub _start { version => $_[HEAP]{o}{ircname}.' v'.$VNDB::VERSION, userinfo => $_[HEAP]{o}{ircname}, )); - $_[HEAP]{irc}->plugin_add( - NickServID => POE::Component::IRC::Plugin::NickServID->new( - Password => $_[HEAP]{o}{pass} - )) if $_[HEAP]{o}{pass}; + if($_[HEAP]{o}{pass}) { + require POE::Component::IRC::Plugin::NickServID; + $_[HEAP]{irc}->plugin_add( + NickServID => POE::Component::IRC::Plugin::NickServID->new( + Password => $_[HEAP]{o}{pass} + )) + } + if($_[HEAP]{o}{console}) { + require POE::Component::IRC::Plugin::Console; + $_[HEAP]{irc}->plugin_add( + Console => POE::Component::IRC::Plugin::Console->new( + bindport => 3030, + password => $_[HEAP]{o}{console} + )) + } $_[KERNEL]->post(circ => register => 'all'); $_[KERNEL]->post(circ => connect => { @@ -344,7 +354,7 @@ sub cmd_uptime { sub cmd_notifications { # $arg = '' or 'on' or 'off' - return if $_[DEST] =~ /^#/ && !&mymaster; + return unless &mymaster; if($_[ARG] =~ /^on$/i) { push @{$_[HEAP]{notify}}, $_[DEST] if !grep $_ eq $_[DEST], @{$_[HEAP]{notify}}; $_[KERNEL]->post(circ => privmsg => $_[DEST], 'Notifications enabled.'); |