From 13658b7da85b8853ba75b96460a57589e2914f8e Mon Sep 17 00:00:00 2001 From: Krille Fear Date: Mon, 15 Nov 2021 13:08:31 +0100 Subject: [PATCH] chore: Trim formatted username fallback A user has a mxid with a trailing "-" which becomes a whitespace here. We should trim those whitespaces after formatting. --- lib/src/user.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/user.dart b/lib/src/user.dart index 8147a0d7..2f9c53cc 100644 --- a/lib/src/user.dart +++ b/lib/src/user.dart @@ -129,7 +129,7 @@ class User extends Event { words[i] = words[i][0].toUpperCase() + words[i].substring(1); } } - return words.join(' '); + return words.join(' ').trim(); } return 'Unknown user'; }