From 5e53f22ad7ba39e124c18b9b20efa2cb0cc12ec3 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Sun, 21 Jan 2018 02:48:43 +0100 Subject: [PATCH] Fixed "beautify real name" --- src/blackmisc/network/user.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/blackmisc/network/user.cpp b/src/blackmisc/network/user.cpp index af531b9f2..b4ad74ee4 100644 --- a/src/blackmisc/network/user.cpp +++ b/src/blackmisc/network/user.cpp @@ -168,7 +168,10 @@ namespace BlackMisc int lc = 0; for (const QChar ch : realName) { - if (uc > 1 && lc > 1) { return newRealName; } // mixed case name, no need to beautify + // Joe Doe -> valid + // jOE dOE -> invalid + // Joe McArthur -> valid + if (uc > 1 && lc > 2 && lc > uc) { return newRealName; } // mixed case name, no need to beautify if (ch.isLower()) { lc++; continue; } if (ch.isUpper()) { uc++; continue;} }