# HG changeset patch # User Matti Hamalainen # Date 1445327015 -10800 # Node ID 25fc5a2b42aec6e8099370b7b14631c6d7a16436 # Parent 3fff571a904b93107b83030d3dd9bf8c20edc657 weather: Use utillib for matching enabled channels. diff -r 3fff571a904b -r 25fc5a2b42ae weather.tcl --- a/weather.tcl Sun Oct 04 14:34:03 2015 +0300 +++ b/weather.tcl Tue Oct 20 10:43:35 2015 +0300 @@ -15,6 +15,9 @@ ### you wish. See "config.weather.example" for an example config file. source [file dirname [info script]]/config.weather +### Required utillib.tcl +source [file dirname [info script]]/utillib.tcl + ########################################################################## # No need to look below this line @@ -466,10 +469,8 @@ proc weather_cmd_pub {unick uhost uhand uchan uargs} { global weather_channels - foreach akey [split $weather_channels ";"] { - if {[string match $akey $uchan]} { - return [weather_cmd $unick $uhand $uchan $uargs 1] - } + if {[utl_match_delim_list $weather_channels $uchan]} { + return [weather_cmd $unick $uhand $uchan $uargs 1] } return 0