X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=src%2FProcess.pl;h=1f00469ea1831438c2dc9787c6b01a29fd44e3bc;hb=3536c5564f248374a76fa5eda24f4b9c5b2c54c1;hp=91b3f9d4aad286176a121fe31148420e9eb3f764;hpb=dd3a610c735093c82495a37a26a6353fd776dc43;p=infobot.git diff --git a/src/Process.pl b/src/Process.pl index 91b3f9d..1f00469 100644 --- a/src/Process.pl +++ b/src/Process.pl @@ -26,8 +26,9 @@ sub process { $learnok = 1 if ($addressed); if ( $param{'learn'} =~ /^HUNGRY$/i ) { $learnok = 1; - $addrchar = 1; - $talkok = 1; + #FIXME: why can we talk if we just want to learn? + #$addrchar = 1; + #$talkok = 1; } &shmFlush(); # hack. @@ -200,7 +201,7 @@ sub process { } # allowOutsiders. - if ( &IsParam('disallowOutsiders') and $msgType =~ /private/i ) { + if ( &IsParam('disallowOutsiders') and $msgType =~ /private/i and IsFlag('o') ne 'o' ) { my $found = 0; foreach ( keys %channels ) { @@ -274,7 +275,7 @@ sub process { } # greetings. - if ( $message =~ /how (the hell )?are (ya|you)( doin\'?g?)?\?*$/ ) { + if ( $message =~ /how (the hell )?are (ya|you)( doin\'?g?)?\?*$/ && $talkok ) { &performReply( &getRandom( keys %{ $lang{'howareyou'} } ) ); return; @@ -303,15 +304,19 @@ sub process { ### # karma. set... - if ( $msgType =~ /public/i - && $message =~ /^(\S+)(--|\+\+)\s*$/ + if ( $message =~ /^(\S+)(--|\+\+)\s*$/ && $addressed && &IsChanConfOrWarn('karma') ) { - # to request factoids such as 'g++' or 'libstdc++', append '?' to the query. + # for factoids such as 'g++' or 'libstdc++', append '?' to query. my ( $term, $inc ) = ( lc $1, $2 ); + if( !( $msgType =~ /public/i ) ) { + &msg( $who, "please use karma in a channel only"); + return; + } + if ( lc $term eq lc $who ) { &msg( $who, "please don't karma yourself" ); return; @@ -349,7 +354,8 @@ sub process { # allow administration of bot via messages (default is DCC CHAT only) if ( &IsFlag('A') ) { - &loadMyModule('UserDCC'); + # UserDCC.pl should autoload now from IRC/. Remove if desired + #&loadMyModule('UserDCC'); $er = &userDCC(); if ( !defined $er ) { return 'SOMETHING 2';