From e9fbd3bebc097c55e0d912e589486072e04f83b5 Mon Sep 17 00:00:00 2001 From: tduva Date: Fri, 21 Jul 2023 20:10:45 +0200 Subject: [PATCH 1/2] Fix subscribers dialog throwing error on channel without access --- src/chatty/gui/components/FollowersDialog.java | 11 ++++++----- src/chatty/lang/Strings.properties | 10 ++++++++++ src/chatty/util/api/FollowerInfo.java | 4 ++++ src/chatty/util/api/FollowerManager.java | 3 ++- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/chatty/gui/components/FollowersDialog.java b/src/chatty/gui/components/FollowersDialog.java index afc418d91..bae2d79ce 100644 --- a/src/chatty/gui/components/FollowersDialog.java +++ b/src/chatty/gui/components/FollowersDialog.java @@ -15,6 +15,7 @@ import chatty.gui.components.menus.StreamsContextMenu; import chatty.gui.components.menus.UserContextMenu; import chatty.gui.components.settings.ListTableModel; +import chatty.lang.Language; import chatty.util.DateTime; import chatty.util.Debugging; import chatty.util.StringUtil; @@ -23,7 +24,6 @@ import chatty.util.api.TwitchApi; import chatty.util.colors.ColorCorrectionNew; import chatty.util.dnd.DockContent; -import chatty.util.dnd.DockContentContainer; import java.awt.Color; import java.awt.Component; import java.awt.Dimension; @@ -41,7 +41,6 @@ import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Path; -import java.nio.file.Paths; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; @@ -183,8 +182,10 @@ public FollowersDialog(Type type, MainGui owner, final TwitchApi api, mainTable = new JScrollPane(table); mainPanel.add(mainTable, gbc); - JTextArea accessInfoText = new JTextArea("The list of followers is only available for moderators. " - + "If you are a moderator you may be missing the required access, see 'Main - Account'."); + JTextArea accessInfoText = new JTextArea( + type == Type.FOLLOWERS + ? Language.getString("followersDialog.accessInfo") + : Language.getString("subscribersDialog.accessInfo")); accessInfoText.setLineWrap(true); accessInfoText.setWrapStyleWord(true); accessInfoText.setEditable(false); @@ -301,7 +302,7 @@ public DockContent getContent() { } private void updateMain() { - boolean showTable = currentInfo == null || currentInfo.total == 0 || !currentInfo.followers.isEmpty(); + boolean showTable = currentInfo == null || currentInfo.total == 0 || currentInfo.hasFollowers(); mainTable.setVisible(showTable); accessInfo.setVisible(!showTable); } diff --git a/src/chatty/lang/Strings.properties b/src/chatty/lang/Strings.properties index 7eb0c153e..df400a4ec 100644 --- a/src/chatty/lang/Strings.properties +++ b/src/chatty/lang/Strings.properties @@ -1504,6 +1504,16 @@ emotesDialog.details.size = Regular Size: emotesDialog.details.by = Emote by: emotesDialog.details.info = Right-click on emotes here or in chat to open context-menu with info/options. +!======================! +!== Followers Dialog ==! +!======================! +followersDialog.accessInfo = The list of followers can only be viewed by moderators. If you are a moderator you may be missing the required access, see 'Main - Account'. + +!========================! +!== Subscribers Dialog ==! +!========================! +subscribersDialog.accessInfo = The list and amount of subscribers can only be viewed by the broadcaster. If you are the broadcaster you may be missing the required access, see 'Main - Account'. + !=====================! !== Defaults Dialog ==! !=====================! diff --git a/src/chatty/util/api/FollowerInfo.java b/src/chatty/util/api/FollowerInfo.java index 2005044de..75c0a7ed2 100644 --- a/src/chatty/util/api/FollowerInfo.java +++ b/src/chatty/util/api/FollowerInfo.java @@ -126,4 +126,8 @@ public FollowerInfo replaceFollowers(List updatedFollowers) { return new FollowerInfo(type, stream, updatedFollowers, total, totalPoints); } + public boolean hasFollowers() { + return followers != null && !followers.isEmpty(); + } + } diff --git a/src/chatty/util/api/FollowerManager.java b/src/chatty/util/api/FollowerManager.java index e73264a86..875deb785 100644 --- a/src/chatty/util/api/FollowerManager.java +++ b/src/chatty/util/api/FollowerManager.java @@ -2,6 +2,7 @@ package chatty.util.api; import chatty.util.DateTime; +import chatty.util.Debugging; import chatty.util.JSONUtil; import chatty.util.StringUtil; import chatty.util.api.Follower.Type; @@ -512,7 +513,7 @@ private void requestSingleFollower(String stream, String streamId, String userna // private static final Instant OLD_FOLLOW_API_OFF = ZonedDateTime.of(2023, 6, 17, 20, 29, 0, 0, ZoneId.of("+02:00")).toInstant(); // For testing only public static boolean forceNewFollowsApi() { - return Instant.now().isAfter(OLD_FOLLOW_API_OFF); + return Debugging.isEnabled("newfollowerapi") || Instant.now().isAfter(OLD_FOLLOW_API_OFF); } } From 3a4c48444cbba737a0e8bb350a0cdc5bff51a046 Mon Sep 17 00:00:00 2001 From: tduva Date: Fri, 21 Jul 2023 20:33:11 +0200 Subject: [PATCH 2/2] v0.25, release info --- src/chatty/Chatty.java | 2 +- .../gui/components/help/help-releases.html | 32 +++++++++++++++++-- src/chatty/gui/components/help/help.html | 2 +- 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/src/chatty/Chatty.java b/src/chatty/Chatty.java index 4ba78948f..0ca2c9e25 100644 --- a/src/chatty/Chatty.java +++ b/src/chatty/Chatty.java @@ -57,7 +57,7 @@ public class Chatty { * by points. May contain a single "b" for beta versions, which are counted * as older (so 0.8.7b4 is older than 0.8.7). */ - public static final String VERSION = "0.25-b2"; // Remember changing the version in the help + public static final String VERSION = "0.25"; // Remember changing the version in the help /** * Enable Version Checker (if you compile and distribute this yourself, you diff --git a/src/chatty/gui/components/help/help-releases.html b/src/chatty/gui/components/help/help-releases.html index 3c8963cbc..1354c1978 100644 --- a/src/chatty/gui/components/help/help-releases.html +++ b/src/chatty/gui/components/help/help-releases.html @@ -75,11 +75,39 @@

Release Information

full list of changes.

- Version 0.25 (This one!) (2023-??-??) + Version 0.25 (This one!) (2023-07-21) [back to top]

-TBD
+### Twitch Features
+- Added amount/currency next to Hype Chat messages, added `config:hypechat`
+  Highlighting prefix
+- Switched to new follower API (only allows moderators to see the list of
+  followers, count is visible for everyone though)
+- Added multi-month subs info to subscriber notifications
+- Improved badge tooltips based on updated API information
+
+### Custom Commands
+- Context Menu/User Dialog custom entries/buttons:
+  - Added ability to show entries only when they match certain restrictions
+    (for example based on channel or user status, see the Custom Commands help)
+  - Entries with empty labels now get removed, so using a required replacement
+    in a label can also serve to hide it based on certain conditions
+  - Added more context-specific parameters for use in labels and restrictions
+  - Added ability to use replacements in User Dialog button labels, like you can
+    in context menus as well
+- Added settings to trigger commands when middle-clicking on user in chat
+  (equivalent to Ctrl+clicking, in the Settings under "Chat")
+
+### Other
+- Select associated message in a few more cases when opening User Dialog
+- Improved support for different `.wav` file formats
+- Updated Gradle to 8.2.1 (and related build changes)
+- Updated Java for the Windows Standalone
+- Updated help
+
+### Bugfixes
+- Fixed channel status warning appearing in Admin Dialog when it shouldn't
     

diff --git a/src/chatty/gui/components/help/help.html b/src/chatty/gui/components/help/help.html index 9b3b9d60a..21744801a 100644 --- a/src/chatty/gui/components/help/help.html +++ b/src/chatty/gui/components/help/help.html @@ -5,7 +5,7 @@ -

Chatty (Version: 0.25-b2)

+

Chatty (Version: 0.25)