From c32879d807d573fa78a2ac23ccc7081b37fdf588 Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Sat, 8 Apr 2017 15:41:11 -0700 Subject: [PATCH 1/2] fix multi-line sessionDisplayName --- assignment-client/src/avatars/AvatarMixer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assignment-client/src/avatars/AvatarMixer.cpp b/assignment-client/src/avatars/AvatarMixer.cpp index f09caac4b6..810de73a5e 100644 --- a/assignment-client/src/avatars/AvatarMixer.cpp +++ b/assignment-client/src/avatars/AvatarMixer.cpp @@ -200,7 +200,7 @@ void AvatarMixer::manageDisplayName(const SharedNodePointer& node) { QString baseName = avatar.getDisplayName().trimmed(); const QRegularExpression curses { "fuck|shit|damn|cock|cunt" }; // POC. We may eventually want something much more elaborate (subscription?). baseName = baseName.replace(curses, "*"); // Replace rather than remove, so that people have a clue that the person's a jerk. - const QRegularExpression trailingDigits { "\\s*_\\d+$" }; // whitespace "_123" + const QRegularExpression trailingDigits { "\\s*_\\d+(\\n[^$]*)?$" }; // trailing whitespace "_123" and any subsequent lines baseName = baseName.remove(trailingDigits); if (baseName.isEmpty()) { baseName = "anonymous"; From 54888f85bec049e0ffb35439af39de7cae42fd83 Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Mon, 10 Apr 2017 08:41:50 -0700 Subject: [PATCH 2/2] strip more --- assignment-client/src/avatars/AvatarMixer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assignment-client/src/avatars/AvatarMixer.cpp b/assignment-client/src/avatars/AvatarMixer.cpp index 810de73a5e..f3da74ce5e 100644 --- a/assignment-client/src/avatars/AvatarMixer.cpp +++ b/assignment-client/src/avatars/AvatarMixer.cpp @@ -200,7 +200,7 @@ void AvatarMixer::manageDisplayName(const SharedNodePointer& node) { QString baseName = avatar.getDisplayName().trimmed(); const QRegularExpression curses { "fuck|shit|damn|cock|cunt" }; // POC. We may eventually want something much more elaborate (subscription?). baseName = baseName.replace(curses, "*"); // Replace rather than remove, so that people have a clue that the person's a jerk. - const QRegularExpression trailingDigits { "\\s*_\\d+(\\n[^$]*)?$" }; // trailing whitespace "_123" and any subsequent lines + const QRegularExpression trailingDigits { "\\s*(_\\d+\\s*)?(\\s*\\n[^$]*)?$" }; // trailing whitespace "_123" and any subsequent lines baseName = baseName.remove(trailingDigits); if (baseName.isEmpty()) { baseName = "anonymous";