Append client version info to user graffiti by default (#9313)

Closes issue #9287


  


Co-Authored-By: Tan Chee Keong <tanck@sigmaprime.io>

Co-Authored-By: chonghe <44791194+chong-he@users.noreply.github.com>

Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
chonghe
2026-06-15 14:03:13 +08:00
committed by GitHub
parent 378f01670b
commit d8e406b6ac
10 changed files with 203 additions and 41 deletions

View File

@@ -832,16 +832,16 @@ impl ClientVersionV1 {
// 12 characters for append_graffiti_full, plus one character for spacing
// that leaves user specified graffiti to be 32-12-1 = 19 characters max, i.e., <20
if graffiti_length < 20 {
format!("{} {}", append_graffiti_full, graffiti_str)
format!("{} {}", graffiti_str, append_graffiti_full)
// user-specified graffiti is between 20-23 characters
} else if (20..24).contains(&graffiti_length) {
format!("{} {}", append_graffiti_one_byte, graffiti_str)
format!("{} {}", graffiti_str, append_graffiti_one_byte)
// user-specified graffiti is between 24-27 characters
} else if (24..28).contains(&graffiti_length) {
format!("{} {}", append_graffiti_no_commit, graffiti_str)
format!("{} {}", graffiti_str, append_graffiti_no_commit)
// user-specified graffiti is between 28-29 characters
} else if (28..30).contains(&graffiti_length) {
format!("{} {}", append_graffiti_only_el, graffiti_str)
format!("{} {}", graffiti_str, append_graffiti_only_el)
// if user-specified graffiti is between 30-32 characters, append nothing
} else {
return graffiti;