From 1adf4ae6da4f5c5493c6ba801ef0b9e081b2ebd1 Mon Sep 17 00:00:00 2001 From: iProdigy <8106344+iProdigy@users.noreply.github.com> Date: Tue, 1 Aug 2023 13:59:46 -0500 Subject: [PATCH] fix(clienthelper): reflect name changes in live events (#828) --- .../main/java/com/github/twitch4j/TwitchClientHelper.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/twitch4j/src/main/java/com/github/twitch4j/TwitchClientHelper.java b/twitch4j/src/main/java/com/github/twitch4j/TwitchClientHelper.java index 6c33d449e..0d29e2b79 100644 --- a/twitch4j/src/main/java/com/github/twitch4j/TwitchClientHelper.java +++ b/twitch4j/src/main/java/com/github/twitch4j/TwitchClientHelper.java @@ -201,9 +201,10 @@ public TwitchClientHelper(TwitchHelix twitchHelix, EventManager eventManager, Sc return; ChannelCache currentChannelCache = channelInformation.computeIfAbsent(userId, s -> new ChannelCache()); - // Disabled name updates while Helix returns display name https://github.com/twitchdev/issues/issues/3 - if (stream != null && currentChannelCache.getUserName() == null) - currentChannelCache.setUserName(stream.getUserName()); + if (stream != null) { + // gracefully support name changes + currentChannelCache.setUserName(stream.getUserLogin()); + } final EventChannel channel = new EventChannel(userId, currentChannelCache.getUserName()); boolean dispatchGoLiveEvent = false;