From b453eecebe494acdf95de02feb38536b8f78228e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 30 Nov 2022 14:43:21 +0900 Subject: [PATCH] Ensure empty pieces do not result in whitespace between elements --- osu.Game/Online/Chat/NowPlayingCommand.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/osu.Game/Online/Chat/NowPlayingCommand.cs b/osu.Game/Online/Chat/NowPlayingCommand.cs index c65b06c6d8..2734b4e6dd 100644 --- a/osu.Game/Online/Chat/NowPlayingCommand.cs +++ b/osu.Game/Online/Chat/NowPlayingCommand.cs @@ -68,7 +68,15 @@ namespace osu.Game.Online.Chat break; } - channelManager.PostMessage($"is {verb} {getBeatmapPart()} {getModPart()}", true, target); + string[] pieces = + { + "is", + verb, + getBeatmapPart(), + getModPart(), + }; + + channelManager.PostMessage(string.Join(' ', pieces.Where(p => !string.IsNullOrEmpty(p))), true, target); Expire(); string getBeatmapPart()