Mercurial > hg > egg-tcls
changeset 346:329ceff76d0c
qdb: Add support for enabled channels.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 20 Oct 2015 10:44:15 +0300 |
parents | 5c6cb115a7a1 |
children | 2968f335121a |
files | config.quotedb.example quotedb.tcl |
diffstat | 2 files changed, 11 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/config.quotedb.example Tue Oct 20 10:43:43 2015 +0300 +++ b/config.quotedb.example Tue Oct 20 10:44:15 2015 +0300 @@ -4,6 +4,12 @@ # ########################################################################## +# Channels where quote functionality is enabled +# set qdb_channels "#foobar;#baz" +# You can use * to match substrings or everything +set qdb_channels "*" + + ### ### SQL database settings ###
--- a/quotedb.tcl Tue Oct 20 10:43:43 2015 +0300 +++ b/quotedb.tcl Tue Oct 20 10:44:15 2015 +0300 @@ -374,7 +374,11 @@ #------------------------------------------------------------------------- proc qdb_command {ucmd utable unick uhost uhand uchan utext upublic} { - global qdb_msg_help + global qdb_msg_help qdb_channels + + if {$upublic && ![utl_match_delim_list $qdb_channels $uchan]} { + return 0 + } set utext [string trim $utext]