# HG changeset patch # User Matti Hamalainen # Date 1612454491 -7200 # Node ID 577763cb88640be107aa6ef20c54d105c9ce8472 # Parent a09401d4ac8ce0279086da394e55fe7e978244b9 urllog: Improve title handling in "URL is known" messages. diff -r a09401d4ac8c -r 577763cb8864 config.urllog.example --- a/config.urllog.example Thu Feb 04 13:51:34 2021 +0200 +++ b/config.urllog.example Thu Feb 04 18:01:31 2021 +0200 @@ -162,13 +162,14 @@ "url_added_long_has_title" "'@1@' (@4@)" "url_added_long_no_title" "@3@" - "url_known_short" "wanha!" - "url_known_long" "wanha!" + "url_known_has_title" "'@2@' " + "url_known_no_title" "" + "url_known_short" "wanha! @5@@7@ (@1@@@4@)" + "url_known_long" "wanha! @5@@6@ (@1@@@4@)" "search_result_has_title" "'@2@' " "search_result_no_title" "" - "search_result_short" "#@1@: @4@@5@ @6@ (@2@ @ @3@)" "search_result_long" "#@1@: @4@@5@ (@2@ @ @3@)" diff -r a09401d4ac8c -r 577763cb8864 urllog.tcl --- a/urllog.tcl Thu Feb 04 13:51:34 2021 +0200 +++ b/urllog.tcl Thu Feb 04 18:01:31 2021 +0200 @@ -157,10 +157,16 @@ urllog_log "URL said by $urlNick ($urlStr) already known" if {[utl_match_delim_list $urllog_pub_channels $uchan]} { + if {[string length $utitle] > 0} { + set stitle [utl_str_map_values [urllog_qm "url_known_has_title"] [list $utitle [urllog_chop_str $utitle $urllog_add_title_max]]] + } else { + set stitle [urllog_qm "url_known_no_title"] + } + if {$urllog_shorturl_enable != 0} { - urllog_verb_msg 1 $urlNick $urlChan "url_known_short" [list $uuser $uchan $uhost [utl_ctime $utime] $utitle $uurl [urllog_get_short $uid]] + urllog_verb_msg 1 $urlNick $urlChan "url_known_short" [list $uuser $uchan $uhost [utl_ctime $utime] $stitle $uurl [urllog_get_short $uid]] } else { - urllog_verb_msg 1 $urlNick $urlChan "url_known_long" [list $uuser $uchan $uhost [utl_ctime $utime] $utitle $uurl] + urllog_verb_msg 1 $urlNick $urlChan "url_known_long" [list $uuser $uchan $uhost [utl_ctime $utime] $stitle $uurl] } } return 1