Ignore:
Timestamp:
08/23/09 19:22:05 (3 years ago)
Author:
james
Message:

New output parser for core plugins - should fix problems with late replacements getting missed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/plugins.tcl

    r1004 r1019  
    284284# Sorted by priority then name 
    285285# Includes plugins only enabled for the given channel 
    286 proc bMotion_plugin_find_output { lang { channel "" } { min_priority 0} { max_priority 100 } } { 
     286proc bMotion_plugin_find_output { lang { channel "" } { min_priority 0} { max_priority 100 } {name "" } } { 
    287287        global bMotion_plugins_output botnicks 
    288288        global bMotion_plugins_output_perchan 
     
    296296                set language [lindex $val $BMOTION_PLUGIN_OUTPUT_LANGUAGE] 
    297297                set priority [lindex $val $BMOTION_PLUGIN_OUTPUT_PRIORITY] 
    298                 if {($priority >= $min_priority) && ($priority <= $max_priority)} { 
    299                         if {[string match $lang $language] || ($language == "any")|| ($language == "all")} { 
    300                                 if {$enabled == 1} { 
    301                                         lappend result [list $callback $priority] 
    302                                 } else { 
    303                                         bMotion_putloglev 1 * "Searching $key for channel $channel" 
    304                                         if {$channel != ""} { 
    305                                                 catch { 
    306                                                         set chanlist $bMotion_plugins_output_perchan($key) 
    307                                                         if {[lsearch $chanlist $channel] > -1} { 
    308                                                                 lappend result [list $callback $priority] 
    309                                                                 bMotion_putloglev d * "Plugin $key is enabled for $channel" 
    310                                                         } 
    311                                                 } 
     298 
     299                if {($name != "") && ($name != $key)} { 
     300                        bMotion_putloglev 3 * "macro: ignoring $key on name" 
     301                        continue 
     302                } 
     303 
     304                if {!(($priority >= $min_priority) && ($priority <= $max_priority))} { 
     305                        bMotion_putloglev 3 * "macro: ignoring $key on priority" 
     306                        continue 
     307                } 
     308 
     309                if {!([string match $lang $language] && ($language != "any") && ($language != "all"))} { 
     310                        bMotion_putloglev 3 * "macro: ignoring $key on language" 
     311                        bMotion_putloglev 3 * "macro: plugin is $lang, want $language" 
     312                        continue 
     313                } 
     314 
     315                if {$enabled == 1} { 
     316                        lappend result [list $callback $priority] 
     317                } else { 
     318                        bMotion_putloglev 1 * "Searching $key for channel $channel" 
     319                        if {$channel != ""} { 
     320                                catch { 
     321                                        set chanlist $bMotion_plugins_output_perchan($key) 
     322                                        if {[lsearch $chanlist $channel] > -1} { 
     323                                                lappend result [list $callback $priority] 
     324                                                bMotion_putloglev d * "Plugin $key is enabled for $channel" 
    312325                                        } 
    313326                                } 
Note: See TracChangeset for help on using the changeset viewer.