improved autoquoting

This commit is contained in:
Luxferre
2024-10-24 15:05:27 +03:00
parent 3bbbdca05f
commit 0cd8ec0eb4
+14
View File
@@ -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