Show
Ignore:
Timestamp:
02/07/2008 10:26:11 (5 months ago)
Author:
james
Message:

filter out more smilies

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/modules/events.tcl

    r939 r941  
    2121############################################################################### 
    2222 
    23 ### bMotionDoEventResponse <<<1 
     23### bMotionDoEventResponse  
    2424proc bMotionDoEventResponse { type nick host handle channel text } { 
    2525        #check our global toggle 
     
    6868} 
    6969 
    70 ### bMotion_event_onjoin <<<1 
     70### bMotion_event_onjoin  
    7171proc bMotion_event_onjoin {nick host handle channel} { 
    7272  #ignore me 
     
    9393 
    9494 
    95 ### bMotion_event_onpart <<<1 
     95### bMotion_event_onpart  
    9696proc bMotion_event_onpart {nick host handle channel {msg ""}} { 
    9797  #check our global toggle 
     
    120120} 
    121121 
    122 ### bMotion_event_onquit <<<1 
     122### bMotion_event_onquit  
    123123proc bMotion_event_onquit {nick host handle channel reason} { 
    124124  global bMotionSettings bMotionInfo 
     
    155155} 
    156156 
    157 ### bMotion_event_main <<<1 
     157### bMotion_event_main  
    158158proc bMotion_event_main {nick host handle channel text} { 
    159159  #check our global toggle 
     
    176176  set channel [string tolower $channel] 
    177177 
    178   #ignore other bots <<<2 
     178  #ignore other bots  
    179179  if {[matchattr $handle b] && (![matchattr $handle I])} { 
    180180    set bMotionCache($channel,last) 0 
     
    182182  } 
    183183 
    184         #make sure we're allowed to talk in here <<<2 
     184        #make sure we're allowed to talk in here  
    185185  if {![channel get $channel bmotion]} { 
    186186    return 0 
    187187  } 
    188188 
    189         #don't trigger on !seen etc <<<2 
     189        #don't trigger on !seen etc  
    190190        if [regexp -nocase "^!(last)?seen" $text] { 
    191191                return 0 
     
    197197        } 
    198198         
    199         #>>> 
    200  
    201199  bMotion_putloglev 4 * "bMotion: entering bMotion_event_main with nick: $nick host: $host handle: $handle chan: $channel text: $text" 
    202200 
    203201  set bMotionOriginalInput $text 
    204202 
    205   #filter bold, etc codes out <<<2 
     203  #filter bold, etc codes out  
    206204  regsub -all "\002" $text "" text 
    207205  regsub -all "\022" $text "" text 
     
    218216        bMotion_check_botnicks 
    219217 
    220   #does this look like a paste? <<<2 
     218  #does this look like a paste?  
    221219  if [regexp -nocase {^[([]?[0-9]{2}[-:.][0-9]{2}. ?[[<(]?[%@+]?[a-z0-9` ]+[@+%]?. \w+} $text] { 
    222220    return 0 
    223221  } 
    224         #>>> 
    225222 
    226223  ## Update the channel idle tracker  
    227224  set bMotionLastEvent($channel) [clock seconds] 
    228225 
    229   #don't let people break us <<<2 
     226  #don't let people break us  
    230227  if {![matchattr $handle n]} { 
    231228    if [regexp -nocase "%(pronoun|me|noun|colen|percent|VAR|\\|)" $text] { 
     
    235232  regsub -all "\</" $text "%slash" text 
    236233         
    237   #If this isn't just a smiley of some kind, trim smilies <<<2 
     234  #If this isn't just a smiley of some kind, trim smilies  
    238235  if {[string length $text] >= ([string length $botnick] + 4)} { 
    239     regsub -all -nocase {[;:=]-?[)D>/]} $text "" text 
     236    regsub -all -nocase {[;:=]-?[()d<>/sp9x]} $text "" text 
    240237    regsub -all {([\-^])_*[\-^];*} $text "" text 
    241238                regsub -all {\\o/} $text "" text 
    242239  } 
    243240 
    244   #Trim stuff <<<2 
     241  #Trim stuff  
    245242  set text [string trim $text] 
    246243 
    247   ## Dump double+ spaces # 
     244  ## Dump double+ spaces  
    248245  regsub -all "  +" $text " " text 
    249         #>>> 
    250246 
    251247  ## Update the last-talked flag for the join system 
     
    254250  set bMotionThisText $text 
    255251 
    256   #if we spoke last, add "$botnick: " if it's not in the line <<<2 
     252  #if we spoke last, add "$botnick: " if it's not in the line  
    257253  if {![regexp -nocase $botnicks $text] && ([bMotion_did_i_speak_last $channel] || [bMotion_setting_get "bitlbee"])} { 
    258254        if [regexp {^[^:]+:.+} $text] { 
     
    262258    set text "${botnick}: $text" 
    263259  } 
    264         #>>> 
    265260  
    266261  if [bMotion_setting_get "bitlbee"] { 
     
    268263  } 
    269264 
    270   #check for someone breaking the loop of lastSpoke <<<2 
     265  #check for someone breaking the loop of lastSpoke  
    271266  if {[regexp -nocase "(i'm not talking to|not) you" $text] && $bMotionCache($channel,last)} { 
    272267    bMotionDoAction $channel $nick "oh" 
     
    275270  } 
    276271  set bMotionCache($channel,last) 0 
    277         #>>> 
    278  
    279   #Run the simple plugins <<<2 
     272 
     273  #Run the simple plugins  
    280274  set response [bMotion_plugin_find_simple $text $bMotionInfo(language)] 
    281275  if {$response != ""} { 
     
    287281  } 
    288282 
    289   #Run the complex plugins <<<2 
     283  #Run the complex plugins  
    290284  set response [bMotion_plugin_find_complex $text $bMotionInfo(language)] 
    291285  if {[llength $response] > 0} { 
     
    316310  } 
    317311 
    318   #Check for all caps <<<2 
     312  #Check for all caps  
    319313  regsub -all {[^A-Za-z]} $text "" textChars 
    320314  regsub -all {[a-z]} $textChars "" textLowerChars 
     
    327321    } 
    328322  } 
    329         #>>> 
    330  
    331   #Reload config files <<<2 
     323 
     324  #Reload config files  
    332325        #TODO: move this into a plugin? 
    333326  if [regexp -nocase "${botnicks},?:? re(hash|load)( your config files?)?" $text] { 
     
    364357  } 
    365358 
    366         #tell the names we have <<<2 
     359        #tell the names we have  
    367360        #TODO: move this into a plugin? 
    368361        if [regexp -nocase "${botnicks}:?,? say my names?(,? bitch)?" $text] { 
     
    389382        } 
    390383 
    391   #shut up <<<2 
     384  #shut up  
    392385        #TODO: move this into a plugin? 
    393386  if [regexp -nocase "^${botnicks}:?,? (silence|shut up|be quiet|go away)" $text] { 
     
    403396  } 
    404397 
    405         #catch actions in stars <<<2 
     398        #catch actions in stars  
    406399  #This is the clever bit. If the text is "*blah blah blah*" reinject it into bMotion as an action ## 
    407400  if [regexp {^\*(.+)\*$} $text blah action] { 
     
    412405} 
    413406 
    414 ### bMotion_event_action <<<1 
     407### bMotion_event_action  
    415408proc bMotion_event_action {nick host handle dest keyword text} { 
    416409 
     
    442435  set nick [bMotion_cleanNick $nick $handle] 
    443436 
    444   #Trim <<<2 
     437  #Trim  
    445438  set text [string trim $text] 
    446439 
     
    454447        bMotion_check_botnicks 
    455448 
    456   #Run the simple plugins <<<2 
     449  #Run the simple plugins  
    457450  set response [bMotion_plugin_find_action_simple $text $bMotionInfo(language)] 
    458451  if {$response != ""} { 
     
    464457  } 
    465458 
    466   #Run the complex plugins <<<2 
     459  #Run the complex plugins  
    467460  set response [bMotion_plugin_find_action_complex $text $bMotionInfo(language)] 
    468461  if {[llength $response] > 0} { 
     
    485478    return 0 
    486479  } 
    487         #>>> 
    488 } 
    489  
    490 ### bMotion_event_mode <<<1 
     480} 
     481 
     482### bMotion_event_mode  
    491483proc bMotion_event_mode {nick host handle channel mode victim} { 
    492484  #check our global toggle 
     
    530522} 
    531523 
    532 ### bMotion_event_nick <<<1 
     524### bMotion_event_nick  
    533525proc bMotion_event_nick { nick host handle channel newnick } { 
    534526 
     
    553545} 
    554546 
    555 # >>> 
    556547bMotion_putloglev d * "bMotion: events module loaded"