Skip to content

Commit

Permalink
Updated to v0.27-b1.
Browse files Browse the repository at this point in the history
  • Loading branch information
23rd committed Jun 29, 2024
2 parents 290e8f8 + 68aaaa2 commit 4e147f7
Show file tree
Hide file tree
Showing 23 changed files with 266 additions and 34 deletions.
12 changes: 12 additions & 0 deletions assets/linux/io.github.chatty.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Desktop Entry]
Version=1.0
Type=Application

Name=Chatty
Comment=twitch.tv chat client
Categories=Network;InstantMessaging;Chat

Icon=chatty
Exec=chatty
Terminal=false
StartupWMClass=chatty-Chatty
82 changes: 82 additions & 0 deletions assets/linux/io.github.chatty.metainfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>io.github.chatty</id>

<name>Chatty</name>
<summary>Twitch.tv chat client</summary>

<metadata_license>MIT</metadata_license>
<project_license>GPL-3.0-or-later and MIT</project_license>

<description>
<p>
Chatty is a chat software specifically made for Twitch, in the spirit of a classic IRC Client.
</p>
<p>
Basic Features
</p>
<p>
Join several channels in tabs, split views or popped out into separate windows Channel Favorites &amp; History Log chat to file, TAB-Completion, Input History Flexible message Highlighting and Ignoring Customizable chat colors, font, line spacings, alternating backgrounds Choose between several Look&amp;Feel, including Dark Mode
</p>
<p>
Watching
</p>
<p>
Get notified when channels you follow go live Easily open streams in your browser, or run Livestreamer (or the more up-to-date Streamlink) out of Chatty
</p>
<p>
Streaming
</p>
<p>
Set your stream title, game &amp; tags (with custom Presets) and run commercials Write current stream uptime to a file and create Stream Marker, via configurable hotkey or Mod Command, to assist in making Stream Highlights List your 100 most recent followers/subscribers Viewerhistory graph of your current streaming session
</p>
<p>
Moderating
</p>
<p>
Click on nick to open customizable User Dialog, showing recent messages and basic account info Optional pause-chat-on-hover to avoid misclicks AutoMod support to approve/deny filtered messages Create Custom Commands and customize Context Menus
</p>
<p>
Emotes &amp; Badges
</p>
<p>
FrankerFaceZ Emotes (&amp; Mod Icons), BetterTTV Emotes (no Personal Emotes though) Unified Bot Badge (using multiple sources) Emote Dialog with Favorites, Subemotes, Channel-specific Emotes, and more.. Emote TAB-Completion using Shift-TAB (configurable) Enter Emoji codes like :thinking:, aided by TAB-Completion Locally hide/ignore individual Emotes or Badges or add your own
</p>
<p>
Other Features
</p>
<p>
Use Chatty in several languages, including English, German, French, Russian, Japanese, and more.. (the help and parts of the GUI aren&apos;t translated, translations thanks to contributers) SpeedRunsLive Race Viewer Global Hotkey support (Windows, Linux, Mac), e.g. to trigger a commerical or Custom Command
</p>
</description>

<url type="homepage">https://chatty.github.io/</url>
<url type="bugtracker">https://chatty.github.io/help/help-troubleshooting.html#report</url>
<url type="faq">https://chatty.github.io/#faq</url>
<url type="help">https://chatty.github.io/help/help.html</url>
<url type="donation">https://chatty.github.io/#contribute</url>
<url type="contact">https://chatty.github.io/#feedback</url>
<url type="vcs-browser">https://github.com/chatty/chatty</url>
<url type="contribute">https://github.com/chatty/chatty#contributions</url>

# TODO: Auto generate me from changelog!
<releases></releases>

<launchable type="desktop-id">io.github.chatty.desktop</launchable>
<screenshots>
<screenshot type="default">
<image>https://chatty.github.io/img/stuff.png</image>
<caption>Screenshot showing the general interface of chatty</caption>
</screenshot>
<screenshot>
<image>https://chatty.github.io/img/Chatty_Split_View.jpg</image>
<caption>Screenshot showing the split view functionality with multiple chats open</caption>
</screenshot>
<screenshot>
<image>https://chatty.github.io/img/userdialog.png</image>
<caption>Screenshot showing the moderation functionality</caption>
</screenshot>
</screenshots>

<content_rating type="oars-1.1"/>
</component>
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ task allPlatformsZip(type: Zip, group: 'build') {
from tasks.shadowJar.archivePath
from ('assets') {
exclude 'lib'
exclude 'linux'
}

destinationDirectory = releasesDir
Expand Down
2 changes: 1 addition & 1 deletion src/chatty/Chatty.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.26.0.168";
public static final String VERSION = "0.27.0.168";

/**
* Enable Version Checker (if you compile and distribute this yourself, you
Expand Down
21 changes: 18 additions & 3 deletions src/chatty/TwitchClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -1950,7 +1950,7 @@ else if (command.equals("bantest")) {
// g.printMessage("test10", testUser, "longer message abc hmm fwef wef wef wefwe fwe ewfwe fwef wwefwef"
// + "fjwfjfwjefjwefjwef wfejfkwlefjwoefjwf wfjwoeifjwefiowejfef wefjoiwefj", false, null, 0);
} else if (command.equals("requestfollowers")) {
api.getFollowers(parameter);
api.getFollowers(parameter, false);
} else if (command.equals("simulate2")) {
c.simulate(parameter);
} else if (command.equals("simulate")) {
Expand Down Expand Up @@ -2733,8 +2733,10 @@ private void handleModAction(ModeratorActionData data) {
chatLog.modAction(data);

User modUser = c.getUser(channel, data.created_by);
modUser.addModAction(data);
g.updateUserinfo(modUser);
if (!data.moderation_action.equals("acknowledge_warning")) {
modUser.addModAction(data);
g.updateUserinfo(modUser);
}

String bannedUsername = ModLogInfo.getBannedUsername(data);
if (bannedUsername != null) {
Expand All @@ -2751,6 +2753,19 @@ private void handleModAction(ModeratorActionData data) {
unbannedUser.addUnban(type, data.created_by);
g.updateUserinfo(unbannedUser);
}
if (data.moderation_action.equals("warn") && data.args.size() > 1) {
String warnedUsername = ModLogInfo.getTargetUsername(data);
if (warnedUsername != null) {
User warnedUser = c.getUser(channel, warnedUsername);
String reason = data.args.get(1);
warnedUser.addWarning(reason, data.created_by);
g.updateUserinfo(warnedUser);
}
}
if (data.moderation_action.equals("acknowledge_warning")) {
modUser.addWarningAcknowledged();
g.updateUserinfo(modUser);
}
}
}

Expand Down
7 changes: 7 additions & 0 deletions src/chatty/TwitchCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,13 @@ public void addNewCommands(Commands commands, TwitchClient client) {
api.shoutout(user, resultListener);
}, "");
});
commands.add("warn", "<user> <reason>", p -> {
Commands.CommandParsedArgs args = p.parsedArgs(2, 2);
String reason = args != null ? args.get(1, "") : "";
userCommand(client, p, args, (user, resultListener) -> {
api.warn(user, reason, resultListener);
}, StringUtil.aEmptyb(reason, "", " (%s)"));
});
//--------------------------
// Broadcaster
//--------------------------
Expand Down
30 changes: 30 additions & 0 deletions src/chatty/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,16 @@ public synchronized void addInfo(String message, String fullText) {
addLine(new InfoMessage(System.currentTimeMillis(), message, fullText));
}

public synchronized void addWarning(String reason, String by) {
setFirstSeen();
addLine(new WarnMessage(System.currentTimeMillis(), reason, by));
}

public synchronized void addWarningAcknowledged() {
setFirstSeen();
addLine(new WarnMessage(System.currentTimeMillis(), null, null));
}

public synchronized void addModAction(ModeratorActionData data) {
setFirstSeen();
addLine(new ModAction(System.currentTimeMillis(), data.moderation_action+" "+ModLogInfo.makeArgsText(data)));
Expand Down Expand Up @@ -1419,6 +1429,26 @@ public ModAction(long time, String commandAndParameters) {

}

public static class WarnMessage extends Message {

public final String reason;
public final String by;

/**
* If reason and by are null, the user has acknowledge a warning.
*
* @param time The timestamp the warning was received
* @param reason The message associated with the warning
* @param by The moderator who has issued the warning
*/
public WarnMessage(long time, String reason, String by) {
super(time);
this.reason = reason;
this.by = by;
}

}

public static class AutoModMessage extends Message {

public final String message;
Expand Down
2 changes: 1 addition & 1 deletion src/chatty/gui/MainGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -4352,7 +4352,7 @@ public void printLowTrustUserInfo(User user, final LowTrustUserMessageData data)
);
printMessage(user, data.text, false, tags);
}

//--------------------------
// Appended Info
//--------------------------
Expand Down
17 changes: 11 additions & 6 deletions src/chatty/gui/MainMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -423,13 +423,18 @@ public void updateLayouts(Map<String, DockLayout> layouts) {

public void updateCustomTabs(List<RoutingTargetInfo> infos) {
customTabsMenu.removeAll();
for (RoutingTargetInfo info : infos) {
String label = info.name;
if (info.messages > -1) {
label = String.format("%s (%d)",
info.name, info.messages);
if (infos.isEmpty()) {
addItem(customTabsMenu, "", "No custom tabs").setEnabled(false);
}
else {
for (RoutingTargetInfo info : infos) {
String label = info.name;
if (info.messages > -1) {
label = String.format("%s (%d)",
info.name, info.messages);
}
addItem(customTabsMenu, "customTab." + info.name, label);
}
addItem(customTabsMenu, "customTab."+info.name, label);
}
}

Expand Down
28 changes: 22 additions & 6 deletions src/chatty/gui/components/FollowersDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import chatty.gui.GuiUtil;
import chatty.gui.laf.LaF;
import chatty.gui.MainGui;
import chatty.gui.components.admin.AdminDialog;
import static chatty.gui.components.admin.AdminDialog.SMALL_BUTTON_INSETS;
import chatty.gui.components.menus.ContextMenu;
import chatty.gui.components.menus.ContextMenuListener;
import chatty.gui.components.menus.StreamsContextMenu;
Expand All @@ -34,6 +36,7 @@
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.BufferedWriter;
Expand All @@ -49,6 +52,8 @@
import java.util.Map;
import java.util.concurrent.ThreadLocalRandom;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
Expand Down Expand Up @@ -96,6 +101,7 @@ public String toString() {
private final JTable table;
private final ListTableModel<Follower> followers = new MyListTableModel();
private final JLabel loadInfo = new JLabel();
private final JButton refreshButton;

private final JScrollPane accessInfo;
private final JScrollPane mainTable;
Expand Down Expand Up @@ -192,16 +198,26 @@ public FollowersDialog(Type type, MainGui owner, final TwitchApi api,
accessInfo = new JScrollPane(accessInfoText);
mainPanel.add(accessInfo, gbc);

gbc = GuiUtil.makeGbc(0, 3, 2, 1, GridBagConstraints.WEST);
gbc = GuiUtil.makeGbc(0, 3, 1, 1, GridBagConstraints.WEST);
gbc.insets = new Insets(2, 5, 5, 5);
mainPanel.add(loadInfo, gbc);

refreshButton = new JButton(Language.getString("admin.button.reload"));
refreshButton.setMargin(SMALL_BUTTON_INSETS);
refreshButton.setIcon(new ImageIcon(AdminDialog.class.getResource("view-refresh.png")));
refreshButton.setMnemonic(KeyEvent.VK_R);
refreshButton.addActionListener(e -> request(true));

gbc = GuiUtil.makeGbc(1, 3, 1, 1, GridBagConstraints.EAST);
gbc.insets = new Insets(2, 5, 5, 5);
mainPanel.add(refreshButton, gbc);

// Timer
Timer timer = new Timer(REFRESH_TIMER, new ActionListener() {

@Override
public void actionPerformed(ActionEvent e) {
request();
request(false);
update();
table.repaint();
}
Expand Down Expand Up @@ -457,13 +473,13 @@ private void setColumnWidth(int column, int width, int minwidth, int maxwidth) {
/**
* Try to request new data if the dialog is open and a stream is set.
*/
private void request() {
private void request(boolean forceRefresh) {
if (isVisible() && stream != null && !stream.isEmpty()) {
loading = true;
if (type == Type.FOLLOWERS) {
api.getFollowers(stream);
api.getFollowers(stream, forceRefresh);
} else if (type == Type.SUBSCRIBERS) {
api.getSubscribers(stream);
api.getSubscribers(stream, forceRefresh);
}
}
}
Expand Down Expand Up @@ -521,7 +537,7 @@ public void showDialog(String stream) {
updateMain();
}
setVisible(true);
request();
request(false);
update();
}

Expand Down
9 changes: 8 additions & 1 deletion src/chatty/gui/components/help/help-releases.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<h1><a name="top">Release Information</a></h1>

<p>
<a href="#0.27">0.27</a> |
<a href="#0.26">0.26</a> |
<a href="#0.25">0.25</a> |
<a href="#0.24.1">0.24.1</a> |
Expand Down Expand Up @@ -76,7 +77,13 @@ <h1><a name="top">Release Information</a></h1>
full list of changes.</p>

<h2>
<a name="0.26">Version 0.26</a> <a name="latest">(This one!)</a> (2024-03-21)
<a name="0.27">Version 0.27</a> <a name="latest">(This one!)</a> (2024-??-??)
<a href="#top" class="top">[back to top]</a>
</h2>
<p>TBD</p>

<h2>
<a name="0.26">Version 0.26</a> (2024-03-21)
<a href="#top" class="top">[back to top]</a>
</h2>
<h3>Custom Tabs</h3>
Expand Down
2 changes: 1 addition & 1 deletion src/chatty/gui/components/help/help.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<h1><a name="top">Chatty (Version: 0.26)</a></h1>
<h1><a name="top">Chatty (Version: 0.27-b1)</a></h1>
<table>
<tr>
<td valign="top">
Expand Down
10 changes: 10 additions & 0 deletions src/chatty/gui/components/textpane/ModLogInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,16 @@ public static String getUnbannedUsername(ModeratorActionData data) {
return null;
}

public static String getTargetUsername(ModeratorActionData data) {
if (!data.args.isEmpty()) {
String username = data.args.get(0);
if (Helper.isValidStream(username)) {
return username;
}
}
return null;
}

@Override
public String toString() {
return text;
Expand Down
Loading

0 comments on commit 4e147f7

Please sign in to comment.