From eba9c47e59ccb95209b38188a2389a63b39e333b Mon Sep 17 00:00:00 2001 From: Luxferre Date: Sun, 27 Oct 2024 18:49:23 +0200 Subject: [PATCH] improved search filter --- tiifetch.tcl | 5 ++++- tiix.tcl | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tiifetch.tcl b/tiifetch.tcl index c483f97..babc051 100755 --- a/tiifetch.tcl +++ b/tiifetch.tcl @@ -154,7 +154,10 @@ proc getfile {url} { } else {return {}} } https - http { - set hs [::http::geturl $url -binary 1 -keepalive 0 -timeout 10000] + set hs "" + while {$hs eq ""} { + set hs [::http::geturl $url -binary 1 -keepalive 0 -timeout 10000] + } if {[::http::ncode $hs] eq "200"} { return [::http::data $hs] } else {return {}} diff --git a/tiix.tcl b/tiix.tcl index e0739fc..c660e62 100755 --- a/tiix.tcl +++ b/tiix.tcl @@ -138,7 +138,8 @@ proc tiix_viewecho {} { sqlite3 msgdb $localdb -readonly true set query {SELECT * FROM `msg` WHERE `echoname` = $tiix_echoname} if {$tiix_filter_regex ne {}} { - append query { AND (`body` LIKE $tiix_filter_regex OR `subj` LIKE $tiix_filter_regex) } + set flt "%$tiix_filter_regex%" + append query { AND (`body` LIKE $flt OR `subj` LIKE $flt) } } if {$tiix_order_byid eq 1} { append query { ORDER BY `id` }