diff --git a/src/chatty/Commands.java b/src/chatty/Commands.java
index cb7946ec6..4d170786d 100644
--- a/src/chatty/Commands.java
+++ b/src/chatty/Commands.java
@@ -188,6 +188,14 @@ public String getArgs() {
return parameters.getArgs();
}
+ public String getArgsTrimNonNull() {
+ String args = StringUtil.trim(getArgs());
+ if (args != null) {
+ return args;
+ }
+ return "";
+ }
+
public boolean hasArgs() {
return !StringUtil.isNullOrEmpty(parameters.getArgs());
}
diff --git a/src/chatty/TwitchClient.java b/src/chatty/TwitchClient.java
index c2b18aa5c..b25eff02b 100644
--- a/src/chatty/TwitchClient.java
+++ b/src/chatty/TwitchClient.java
@@ -73,6 +73,7 @@
import chatty.util.api.Follower;
import chatty.util.api.FollowerInfo;
import chatty.util.api.ResultManager;
+import chatty.util.api.ResultManager.CreateClipResult;
import chatty.util.api.StreamCategory;
import chatty.util.api.StreamInfo.StreamType;
import chatty.util.api.StreamInfo.ViewerStats;
@@ -1629,9 +1630,18 @@ private void addCommands() {
commandAddStreamMarker(p.getRoom(), p.getArgs());
});
commands.add("createClip", p -> {
- api.createClip(p.getRoom().getStream(), result -> {
- g.printLine(p.getRoom(), result);
+ api.subscribe(ResultManager.Type.CREATE_CLIP, commands, (CreateClipResult) (editUrl, viewUrl, error) -> {
+ if (error != null) {
+ g.printLine(p.getRoom(), error);
+ }
+ else {
+ // Update indices when changing info text
+ MsgTags tags = MsgTags.createLinks(
+ new MsgTags.Link(MsgTags.Link.Type.URL, editUrl, 14, 22));
+ g.printInfo(p.getRoom(), "Clip created (Edit Clip): "+viewUrl, tags);
+ }
});
+ api.createClip(p.getRoom().getStream());
});
c.addNewCommands(commands, this);
commands.add("addStreamHighlight", p -> {
@@ -2109,7 +2119,7 @@ public void run() {
} else if (command.equals("testr")) {
api.test();
} else if (command.equals("joinlink")) {
- MsgTags tags = MsgTags.create("chatty-channel-join", Helper.toChannel("twitch"));
+ MsgTags tags = MsgTags.createLinks(new MsgTags.Link(MsgTags.Link.Type.JOIN, Helper.toChannel("twitch"), "Join"));
g.printInfo(c.getRoomByChannel(channel), "Join link:", tags);
}
}
@@ -2753,7 +2763,7 @@ public void messageReceived(chatty.util.api.eventsub.Message message) {
String channel = Helper.toChannel(raid.fromLogin);
String text = String.format("[Raid] Now raiding %s with %d viewers.",
raid.toLogin, raid.viewers);
- MsgTags tags = MsgTags.create("chatty-channel-join", Helper.toChannel(raid.toLogin));
+ MsgTags tags = MsgTags.createLinks(new MsgTags.Link(MsgTags.Link.Type.JOIN, Helper.toChannel(raid.toLogin), "Join"));
g.printInfo(c.getRoomByChannel(channel), text, tags);
}
String pollMessage = PollPayload.getPollMessage(message);
@@ -2784,7 +2794,7 @@ public void messageReceived(chatty.util.api.eventsub.Message message) {
String infoText = String.format("[Shoutout] Was given to %s (@%s)",
shoutout.target_name,
shoutout.moderator_login);
- MsgTags tags = MsgTags.create("chatty-channel-join", Helper.toChannel(shoutout.target_login));
+ MsgTags tags = MsgTags.createLinks(new MsgTags.Link(MsgTags.Link.Type.JOIN, Helper.toChannel(shoutout.target_login), "Join"));
g.printInfo(c.getRoomByChannel(channel), infoText, tags);
// Mod Action
List args = new ArrayList<>();
diff --git a/src/chatty/TwitchCommands.java b/src/chatty/TwitchCommands.java
index 70f40bc1c..96b0cdc4f 100644
--- a/src/chatty/TwitchCommands.java
+++ b/src/chatty/TwitchCommands.java
@@ -6,6 +6,7 @@
import chatty.gui.UrlOpener;
import chatty.lang.Language;
import chatty.util.DateTime;
+import chatty.util.RecentlyAffectedUsers;
import chatty.util.StringUtil;
import chatty.util.api.TwitchApi;
import chatty.util.api.TwitchApi.SimpleRequestResultListener;
@@ -58,7 +59,7 @@ public class TwitchCommands {
private static final Set OTHER_COMMANDS = new HashSet<>(Arrays.asList(new String[]{
}));
- private TwitchConnection c;
+ private final TwitchConnection c;
public TwitchCommands(TwitchConnection c) {
this.c = c;
@@ -392,6 +393,7 @@ private void userCommand(TwitchClient client,
if (r.error == null) {
// Success
client.g.addToLine(p.getRoom(), objectId, "OK");
+ RecentlyAffectedUsers.addUser(user);
}
else {
// Failed
diff --git a/src/chatty/gui/MainGui.java b/src/chatty/gui/MainGui.java
index 6a3617765..5d2933536 100644
--- a/src/chatty/gui/MainGui.java
+++ b/src/chatty/gui/MainGui.java
@@ -2731,10 +2731,14 @@ public void usericonClicked(Usericon usericon, MouseEvent e) {
}
@Override
- public void linkClicked(Channel channel, String link) {
- if (link.startsWith("join.")) {
- String c = link.substring("join.".length());
- client.joinChannel(c);
+ public void linkClicked(Channel channel, MsgTags.Link link) {
+ switch (link.type) {
+ case JOIN:
+ client.joinChannel(link.target);
+ break;
+ case URL:
+ UrlOpener.openUrl(link.target);
+ break;
}
}
@@ -2865,6 +2869,15 @@ else if (!Helper.isValidStream(username)) {
openUserInfoDialog(user, p.getParameters().get("msg-id"), null);
}
});
+ client.commands.addEdt("userinfoRecent", p -> {
+ User user = RecentlyAffectedUsers.poll(p.getChannel());
+ if (user == null) {
+ printSystem(p.getRoom(), "No recently affected user found");
+ }
+ else {
+ openUserInfoDialog(user, p.getParameters().get("msg-id"), null);
+ }
+ });
client.commands.addEdt("search", p -> {
openSearchDialog();
});
diff --git a/src/chatty/gui/UserListener.java b/src/chatty/gui/UserListener.java
index 7b081f6cc..2d61670fe 100644
--- a/src/chatty/gui/UserListener.java
+++ b/src/chatty/gui/UserListener.java
@@ -5,6 +5,7 @@
import chatty.gui.components.Channel;
import chatty.util.api.Emoticon;
import chatty.util.api.usericons.Usericon;
+import chatty.util.irc.MsgTags;
import java.awt.event.MouseEvent;
/**
@@ -21,7 +22,7 @@ public interface UserListener {
public void userClicked(User user, String messageId, String autoModMsgId, MouseEvent e);
public void emoteClicked(Emoticon emote, MouseEvent e);
public void usericonClicked(Usericon usericon, MouseEvent e);
- public void linkClicked(Channel channel, String link);
+ public void linkClicked(Channel channel, MsgTags.Link link);
public void imageClicked(String url);
}
diff --git a/src/chatty/gui/components/help/help-builtin_commands.html b/src/chatty/gui/components/help/help-builtin_commands.html
index 7f545f2bc..6b98c7a5c 100644
--- a/src/chatty/gui/components/help/help-builtin_commands.html
+++ b/src/chatty/gui/components/help/help-builtin_commands.html
@@ -124,6 +124,11 @@
Open windows in Chatty
/openSubscribers - Opens the according dialog
/userinfo <username> - To open the User Info Dialog
on a specific user of the current channel (if available)
+
/userinfoRecent - To open the User Info Dialog on a
+ user recently affected by a Twitch Command or with recently open
+ User Dialog on that channel. Repeately executing the command (e.g.
+ through a hotkey) goes back in the history of recently affected
+ users, up to 10 users.
/releaseinfo - Opens the help with the release information
Custom Tabs allow you to route message from regular channels to a Custom Tab based on Highlight matching rules.
+
The new to: prefix (for Highlights, Ignore, Msg. Colours and the new Routing setting) specifies the name of the Custom Tab you want to route the matching messages to. For example adding to:Mentions regw:yourname to the Custom Tabs Routing list will copy all messages containing the word "yourname" to a tab called "Mentions".
+
There are also options to copy the text of Desktop Notifications to a Custom Tab, logging Custom Tab messages to a file and more.
+
Message History
+
Added a message history on channel join, which can be enabled in the Settings under "History". It can show regular chat messages from the last 24h for many channels based on the recent-messages.robotty.de API.
+
Channel Moderation Panel
+
Added an "M" button to the input field that opens a panel for changing channel modes (available only for moderators).
+
Twitch Features
+
+
Added command /createClip for creating a clip on the current channel
+
Added support for Content Classification Labels to Admin Dialog
+
+
Other
+
+
Added support for animated overlayed emotes and 7TV zero-width-emotes
+
Added prefix config:afterban to match on messages after the user was banned/timed out (if Chatty is aware of it)
+
Added prefix msgs: to match on the user's past messages (as they are shown in the User Dialog)
+
Added command /userinfoRecent to open User Info Dialog for user recently affected by a Twitch Command or with recently open User Dialog
+
Updated Pronouns service to new API
+
Added Look&Feel MacOS options (screen menubar, system colors for title bar)
+
Added setting under "Window" to toggle input length limits
+
Various GUI improvements
+
Updated help
+
+
Bugfixes
+
+
Fixed error in context menu for some types of messages
+
Fixed AutoMod Dialog hotkeys reacting when they shouldn't when docked as a tab
+
Fixed favorited emotes not being detected as usable in some cases
+
Fixed PageUp/PageDown sometimes scrolling in wrong channel (by adding as configurable hotkey acting on the active channel)
+
Fixed "Join"-entry being shown in URL context menu when it shouldn't
+
Fixed "User to never highlight" setting not applying to info messages with an attached user
+
Fixed default tab highlight/unread colors not updating when changing from dark to light LaF
+
Fixed tab joined state not always showing correctly after reconnecting
+
Fixed links that are displayed over several lines being clickable in empty spaces in between
+
Version 0.25 (2023-07-21)
diff --git a/src/chatty/gui/components/help/help.html b/src/chatty/gui/components/help/help.html
index 322c153a9..1ab29dc95 100644
--- a/src/chatty/gui/components/help/help.html
+++ b/src/chatty/gui/components/help/help.html
@@ -5,7 +5,7 @@
-