Changeset 886

Show
Ignore:
Timestamp:
02/16/08 20:05:22 (11 months ago)
Author:
james
Message:

partial fix for #153

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/modules/system.tcl

    r883 r886  
    147147        global bMotionLastEvent bMotionChannels bMotionInfo  
    148148 
     149        set timeNow [clock seconds] 
     150 
    149151        # check if it's worth doing anything 
    150152        if {[bMotion_setting_get "bitlbee"]} { 
     
    199201        global BMOTION_SLEEP 
    200202 
    201         set timeNow [clock seconds] 
    202203        set saidChannels [list] 
    203204        set silentChannels [list] 
     
    348349        global botnicks 
    349350 
    350         bMotion_putloglev 2 * "checking $text to see if they're talking to me" 
    351         if [regexp -nocase "^$botnicks\[ :,\]" $text] { 
    352                 bMotion_putloglev 2 * "`- yes"   
    353                 return 1 
     351        bMotion_putloglev 4 * "bMotionTalkingToMe $text" 
     352 
     353        # look for a nick at the start of the line 
     354        if [regexp -nocase {^([^ :,]+)} $text matches nick] { 
     355                bMotion_putloglev 2 * "looks like they're talking to $nick" 
     356                if [regexp -nocase $botnicks $nick] { 
     357                        bMotion_putloglev 2 * "that's me!" 
     358                        return 1 
     359                } 
    354360        } 
    355361 
    356362        if [regexp -nocase "$botnicks\[!?~\]*$" $text] { 
    357                 bMotion_putloglev 2 * "`- yes"   
    358                 return 1 
    359         } 
    360  
    361         bMotion_putloglev 2 * "`- no" 
     363                bMotion_putloglev 2 * "found my name at the end of the line" 
     364                return 1 
     365        } 
     366 
     367        bMotion_putloglev 2 * "not talking to me" 
    362368        return 0 
    363369}