tii

Tcl-based suite for working with ii/idec protocol
git clone git://git.luxferre.top/tii.git
Log | Files | Refs | README

commit 0cd8ec0eb46d57d2186a007dde947fc084996497
parent 3bbbdca05fda21709ca72fa319ea1210d2fc58b2
Author: Luxferre <lux@ferre>
Date:   Thu, 24 Oct 2024 15:05:27 +0300

improved autoquoting

Diffstat:
Mtiix.tcl | 14++++++++++++++
1 file changed, 14 insertions(+), 0 deletions(-)

diff --git a/tiix.tcl b/tiix.tcl @@ -328,6 +328,7 @@ ttk::button .tabbar.p.addrframe.send -text "Send!" -command { set result [dict get $res result] if {$status} { set tiix_status "Posting success: $result" + .tabbar.p.content.text delete 1.0 end } else { set tiix_status "Posting error: $result" } @@ -404,6 +405,19 @@ proc updatefromreps {} { if {![string match "Re: *" $tiix_post_subj]} { set tiix_post_subj "Re: $tiix_post_subj" } + set textw .tabbar.p.content.text + # some nickname shortening heuristics + set shortnick $tiix_post_to + set parts [split $shortnick " "] + if {[llength $parts] > 1} { + set shortnick "" + foreach p $parts { + append shortnick [string index $p 0] + } + } + if {![string match "$shortnick>*" [$textw get 1.0 1.end]]} { + $textw insert 1.0 "[string trimright [join [lmap s $msg(body) {string cat $shortnick {> } $s}] \n]]\n" + } } msgdb close