Skip to content

Commit

Permalink
Updated to v0.13-b5.
Browse files Browse the repository at this point in the history
  • Loading branch information
23rd committed Oct 14, 2020
2 parents 8ac948e + 330bd9f commit 260a3cb
Show file tree
Hide file tree
Showing 9 changed files with 310 additions and 51 deletions.
16 changes: 16 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import java.util.regex.Matcher

plugins {
id "com.github.johnrengelman.shadow" version "6.0.0"
id "org.gradle.crypto.checksum" version "1.1.0"
id "java"
}

Expand Down Expand Up @@ -242,3 +243,18 @@ task innosetupStandalone(type: Exec, group: 'build') {
task releaseWinSetups(group: 'build') {
dependsOn releaseWindows, innosetup, innosetupStandalone, build
}

//---------
// Checksum
//---------

import org.gradle.crypto.checksum.Checksum

task createChecksums(type: Checksum) {
files = layout.files { releasesDir.listFiles() }.filter { File f ->
f.name.endsWith(".exe") || f.name.endsWith(".zip")
}
outputDir = new File(releasesDir, "v"+version)
algorithm = Checksum.Algorithm.SHA256
}

1 change: 1 addition & 0 deletions src/chatty/SettingsManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ public void defineSettings() {
settings.addLong("emoteMaxHeight", 0);
settings.addLong("emoteScale", 100);
settings.addLong("emoteScaleDialog", 100);
settings.addList("emoteHiddenSets", new ArrayList<>(), Setting.STRING);
settings.addBoolean("closeEmoteDialogOnDoubleClick", false);
settings.addBoolean("ffz", true);
settings.addBoolean("ffzEvent", true);
Expand Down
2 changes: 1 addition & 1 deletion src/chatty/TwitchClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -2917,7 +2917,7 @@ public void onChannelJoined(User user) {

@Override
public void onChannelLeft(Room room, boolean closeChannel) {
chatLog.info(room.getFilename(), "You have left "+room.getDisplayName());
chatLog.info(room.getFilename(), "You have left "+room.getDisplayName(), null);
if (closeChannel) {
closeChannel(room.getChannel());
}
Expand Down
17 changes: 16 additions & 1 deletion src/chatty/TwitchConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -1135,14 +1135,29 @@ void onUsernotice(String channel, String message, MsgTags tags) {
if (months == -1) {
months = tags.getInteger("msg-param-months", -1);
}
int giftMonths = tags.getInteger("msg-param-gift-months", -1);

if (StringUtil.isNullOrEmpty(login, text)) {
return;
}
User user = userJoined(channel, login);
updateUserFromTags(user, tags);
if (tags.isValueOf("msg-id", "resub", "sub", "subgift", "anonsubgift")) {
text = text.trim();
if (giftMonths > 1 && !text.matches(".* gifted "+giftMonths+" .*")) {
text += " They gifted "+giftMonths+" months!";
}
// There are still some types of notifications that don't have
// this info, and it might be useful
if (months > 1 && !text.matches(".*\\b"+months+"\\b.*")) {
text += " They've subscribed for "+months+" months!";
String recipient = tags.get("msg-param-recipient-display-name");
if (StringUtil.isNullOrEmpty(recipient)) {
recipient = "They've";
}
else {
recipient += " has";
}
text += " "+recipient+" subscribed for "+months+" months!";
}
listener.onSubscriberNotification(user, text, message, months, tags);
} else if (tags.isValue("msg-id", "charity") && login.equals("twitch")) {
Expand Down
18 changes: 10 additions & 8 deletions src/chatty/gui/MainGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,7 @@ private void loadSettingsInternal() {
streamChat.setMessageTimeout((int)client.settings.getLong("streamChatMessageTimeout"));

emotesDialog.setEmoteScale((int)client.settings.getLong("emoteScaleDialog"));
emotesDialog.setHiddenEmotesets(client.settings.getList("emoteHiddenSets"));
emotesDialog.setCloseOnDoubleClick(client.settings.getBoolean("closeEmoteDialogOnDoubleClick"));

adminDialog.setStatusHistorySorting(client.settings.getString("statusHistorySorting"));
Expand Down Expand Up @@ -3004,7 +3005,7 @@ public void run() {

if (!ignored || client.settings.getBoolean("logIgnored")) {
client.chatLog.bits(chan.getFilename(), user, bitsAmount);
client.chatLog.message(chan.getFilename(), user, text, action);
client.chatLog.message(chan.getFilename(), user, text, action, null);
}

boolean highlighted = false;
Expand Down Expand Up @@ -3051,7 +3052,7 @@ public void run() {
ignoredMessages.addMessage(channel, user, text, action,
tagEmotes, bitsForEmotes, whisper, ignoreMatches,
tags);
client.chatLog.message("_ignored", user, "["+channel+"] "+text, action);
client.chatLog.message("ignored", user, text, action, channel);
ignoredMessagesHelper.ignoredMessage(channel);
}
long ignoreMode = client.settings.getLong("ignoreMode");
Expand Down Expand Up @@ -3101,7 +3102,7 @@ public void run() {
chan.printMessage(message, timestamp);
if (highlighted) {
highlightedMessages.addMessage(channel, message);
client.chatLog.message("_highlighted", user, "["+channel+"] "+text, action);
client.chatLog.message("highlighted", user, text, action, channel);
}
if (client.settings.listContains("streamChatChannels", channel)) {
streamChat.printMessage(message);
Expand Down Expand Up @@ -3406,7 +3407,7 @@ private boolean printInfo(Channel channel, InfoMessage message) {
// After colors and everything is set
if (highlighted) {
highlightedMessages.addInfoMessage(channel.getChannel(), message);
client.chatLog.info("_highlighted", "["+channel.getChannel()+"] "+message);
client.chatLog.info("highlighted", message.text, channel.getChannel());
}
}
channel.printInfoMessage(message);
Expand All @@ -3415,7 +3416,7 @@ private boolean printInfo(Channel channel, InfoMessage message) {
}
} else if (!message.isHidden()) {
ignoredMessages.addInfoMessage(channel.getRoom().getDisplayName(), message.text);
client.chatLog.info("_ignored", "["+channel.getChannel()+"] "+message);
client.chatLog.info("ignored", message.text, channel.getChannel());
}

//----------
Expand All @@ -3427,7 +3428,7 @@ private boolean printInfo(Channel channel, InfoMessage message) {
// ModLog message could be ModLogInfo or generic ModInfo (e.g. for
// abandoned messages), so just checking the text instead of type or
// something (ModActions are logged separately)
client.chatLog.info(channel.getFilename(), message.text);
client.chatLog.info(channel.getFilename(), message.text, null);
}
return !ignored;
}
Expand Down Expand Up @@ -4811,12 +4812,13 @@ private class MySettingsListener implements SettingsListener {

@Override
public void aboutToSaveSettings(Settings settings) {
if (SwingUtilities.isEventDispatchThread()) {
GuiUtil.edtAndWait(() -> {
System.out.println("Saving GUI settings.");
client.settings.setLong("favoritesSorting", favoritesDialog.getSorting());
emoticons.saveFavoritesToSettings(settings);
client.settings.setString("statusHistorySorting", adminDialog.getStatusHistorySorting());
}
client.settings.putList("emoteHiddenSets", emotesDialog.getHiddenEmotesets());
}, "Save GUI settings");
}

}
Expand Down
Loading

0 comments on commit 260a3cb

Please sign in to comment.