Ignore:
Timestamp:
02/01/10 18:59:10 (2 years ago)
Author:
james
Message:

add channel-level flood checking too

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/events.tcl

    r961 r1069  
    266266 
    267267        #check for someone breaking the loop of lastSpoke  
    268         if {[regexp -nocase "(i'm not talking to|not) you" $text] && $bMotionCache($channel,last)} { 
     268        if {[regexp -nocase "(i'm not talking to|not) you" $text] && [bMotion_did_i_speak_last $channel]} { 
    269269                bMotionDoAction $channel $nick "oh" 
    270270                set bMotionCache($channel,last) 0 
     
    278278                bMotion_flood_add $nick "" $text 
    279279                if [bMotion_flood_check $nick] { return 0 } 
     280                if [bMotion_flood_check $channel] { return 0 } 
     281                bMotion_flood_add $channel "" $text 
    280282                set nick [bMotionGetRealName $nick $host] 
    281283                bMotionDoAction $channel $nick [pickRandom $response] 
     
    287289        if {[llength $response] > 0} { 
    288290        #set nick [bMotionGetRealName $nick $host] 
     291                if [bMotion_flood_check $channel] { return 0 } 
    289292                bMotion_putloglev 1 * "going to run plugins: $response" 
    290293                foreach callback $response { 
     
    295298                        set result 0 
    296299                        set result [$callback $nick $host $handle $channel $text] 
     300                        bMotion_putloglev d * "returned from $callback" 
    297301                        set bMotionCache(lastPlugin) $callback 
    298302                        bMotion_plugin_history_add $channel "complex" $callback 
     
    304308                        if {$result > 0} { 
    305309                                if {$result == 1} { 
     310                                        bMotion_putloglev 1 * "adding flood counters" 
    306311                                        bMotion_flood_add $nick $callback $text 
     312                                        bMotion_flood_add $channel $callback $text 
    307313                                } 
    308314                                bMotion_putloglev 2 * "bMotion:          `-$callback returned $result, breaking out..." 
     
    453459        if {$response != ""} { 
    454460                bMotion_flood_add $nick "" $text 
     461                if [bMotion_flood_check $nick] { return 0 } 
     462                if [bMotion_flood_check $channel] { return - } 
     463                bMotion_flood_add $channel "" $text 
    455464                bMotion_putloglev 1 * "bMotion: matched simple action plugin, outputting $response..." 
    456465                set nick [bMotionGetRealName $nick $host] 
     
    463472        if {[llength $response] > 0} { 
    464473        #set nick [bMotionGetRealName $nick $host] 
     474                if [bMotion_flood_check $channel] { return 0 } 
    465475                bMotion_putloglev 1 * "going to run action plugins: $response" 
    466476                foreach callback $response { 
     
    473483                                if {$result == 1} { 
    474484                                        bMotion_flood_add $nick $callback $text 
     485                                        bMotion_flood_add $channel $callback $text 
    475486                                } 
    476487                                bMotion_putloglev 2 * "bMotion:          `-$callback returned $result, breaking out..." 
Note: See TracChangeset for help on using the changeset viewer.