Ignore:
Timestamp:
04/22/09 14:00:16 (3 years ago)
Author:
james
Message:

fix broken debug output
fix not greeting unknown users due to multiple handles matching '*'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/en/irc_join.tcl

    r961 r1002  
    1414  #if the user isban then dont bother 
    1515  if {[ischanban $nick $channel] == 1 } { 
    16     bMotion_putloglev 2 d "dropping greeting for $nick on $channel as user is banned" 
     16    bMotion_putloglev d * "dropping greeting for $nick on $channel as user is banned" 
    1717    return 0 
    1818  } 
     
    2424        #if 0, someone has said something since 
    2525        if {$lasttalk == 1} { 
    26                 bMotion_putloglev 2 d "dropping greeting for $nick on $channel because it's too idle" 
     26                bMotion_putloglev d * "dropping greeting for $nick on $channel because it's too idle" 
    2727                return 0 
    2828        } 
    2929 
    30         # check if the user is already in the channel - probably means they've joined a 2nd client 
    31         # or that they're about to ping out or something 
    32         set count 0 
    33         foreach n [chanlist $channel] { 
    34                 if {[nick2hand $n $channel] == $handle} { 
     30        # skip this check if handle is * as it's pointless 
     31        if {$handle == "*"} { 
     32                # check if the user is already in the channel - probably means they've joined a 2nd client 
     33                # or that they're about to ping out or something 
     34                set count 0 
     35                foreach n [chanlist $channel] { 
     36                        if {[nick2hand $n $channel] == $handle} { 
    3537                        # we have a match 
    36                         incr count 
     38                                incr count 
     39                        } 
    3740                } 
    38         } 
    39          
    40         if {$count >= 2} { 
    41                 bMotion_putloglev d * "$nick has $count matching handles in $channel, so not greeting" 
    42                 return 1 
     41 
     42                if {$count >= 2} { 
     43                        bMotion_putloglev d * "$nick has $count matching handles in $channel, so not greeting" 
     44                        return 1 
     45                } 
    4346        } 
    4447 
    4548        #we must also see if we're next to greet 
    4649        if {![bMotion_interbot_me_next $channel]} { 
     50                bMotion_putloglev 1 * "we're not next for $channel, so not greeting" 
    4751                return 1 
    4852        } 
     
    5054        if {[bMotion_setting_get "friendly"] == "2"} { 
    5155                # don't greet anyone 
     56                bMotion_putloglev 1 * "we're friendly==2 so not greeting $nick in $channel" 
    5257                return 0 
    5358        } 
     
    6065        if {$handle == "*"} { 
    6166                if {[bMotion_setting_get "friendly"] != "1"} { 
     67                        bMotion_putloglev d * "$nick has no handle and friendly!=1 so not greeting" 
    6268                        return 0 
    6369                } 
     
    7177                if {![rand 10]} { 
    7278                        set greetings "insult_joins" 
     79                        bMotion_putloglev d * "decided to be rude to $nick on join as i know them" 
    7380                } 
    7481                bMotionGetHappy 
Note: See TracChangeset for help on using the changeset viewer.