Ignore:
Timestamp:
04/28/09 19:23:31 (3 years ago)
Author:
james
Message:

Add new away admin plugin
Add some debug to randomstuff/away code
Include away status in .bmotion status
Fix .bmotion help being broken

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/system.tcl

    r1003 r1004  
    166166        global bMotionChannels bMotionInfo 
    167167 
     168        bMotion_putloglev 4 * "bMotion_random_away" 
     169 
    168170        set timeNow [clock seconds] 
    169171 
     
    171173        if {[bMotion_setting_get "bitlbee"]} { 
    172174                #never go away in bitlbee 
     175                bMotion_putloglev "going away is disabled in bitlbee mode" 
    173176                return 0 
    174177        } 
     
    176179        #override if we should never go away 
    177180        if {[bMotion_setting_get "useAway"] != 1} { 
     181                bMotion_putloglev "going away is disabled" 
    178182                return 0 
    179183        } 
     
    196200 
    197201        if {($timeNow - $mostRecent) < $gapTime} { 
     202                bMotion_putloglev 1 * "most recent is busy enough, not going away" 
    198203                return 0 
    199204        } 
     
    201206        if {$bMotionInfo(away) == 1} { 
    202207                #away, don't do anything (and don't do randomstuff) 
     208                bMotion_putloglev d * "I'm already away, not going away again" 
    203209                return 0 
    204210        } 
     
    208214                bMotionSetRandomAway 
    209215                return 1 
     216        } else { 
     217                bMotion_putloglev d * "All channels are idle, not going away though" 
    210218        } 
    211219 
     
    220228        global BMOTION_SLEEP 
    221229 
     230        bMotion_putloglev 4 * "doRandomStuff" 
     231 
    222232        set saidChannels [list] 
    223233        set silentChannels [list] 
     
    233243        set temp [expr [rand $upperLimit] + $bMotionInfo(minRandomDelay)] 
    234244        timer $temp doRandomStuff 
    235         bMotion_putloglev d * "bMotion: randomStuff next ($temp minutes)" 
     245        bMotion_putloglev d * "bMotion: randomStuff next in $temp minutes" 
    236246 
    237247        # don't bother if we're asleep 
     
    244254 
    245255        if [bMotion_random_away] { 
    246         # we went away, so stop here 
     256                # we went away, so stop here 
     257                bMotion_putloglev d * "we went away, returning from doRandomStuff" 
    247258                return 
    248259        } 
    249260 
    250261        if {$bMotionInfo(away) == 1} { 
    251         #away and busy again, return 
     262                #away and busy again, return 
     263                bMotion_putloglev d * "was away, setting myself back" 
    252264                bMotionSetRandomBack 
    253265        } 
    254266 
    255267        if {[bMotion_setting_get "bitlbee"] == "1"} { 
     268                bMotion_putloglev d * "aborting randomstuff, don't do it in bitlbee mode" 
    256269                return 0 
    257270        } 
     
    329342proc bMotionSetRandomAway {} { 
    330343        global randomAways bMotionInfo bMotionSettings bMotionChannels 
     344        bMotion_putloglev 4 * "bMotionSetRandomAway" 
    331345 
    332346        set awayReason [bMotion_abstract_get "randomAways"] 
     
    348362        #set myself back 
    349363        global bMotionInfo bMotionSettings bMotionChannels 
     364        bMotion_putloglev 4 * "bMotionSetRandomBack" 
    350365 
    351366        bMotion_update_chanlist 
     
    353368        set bMotionInfo(away) 0 
    354369        set bMotionInfo(silence) 0 
     370        bMotion_putloglev d * "No longer silent or away" 
    355371        foreach channel $bMotionChannels { 
    356372                if {[lsearch $bMotionSettings(noAwayFor) $channel] == -1} { 
Note: See TracChangeset for help on using the changeset viewer.