Skip to content

Commit

Permalink
v0.8.2, URL parsing
Browse files Browse the repository at this point in the history
- Change to version 0.8.2
- Change /connection command duration output
- Allow URLs to contain more than one consecutive point (..)
- Update help
  • Loading branch information
tduva committed Apr 26, 2016
1 parent fcc91e9 commit 04d37ee
Show file tree
Hide file tree
Showing 11 changed files with 65 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@
*.png binary
*.so binary
*.war binary
*.wav binary
*.wav binary
2 changes: 1 addition & 1 deletion src/chatty/Chatty.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class Chatty {
/**
* Version number of this version of Chatty
*/
public static final String VERSION = "0.8.2b";
public static final String VERSION = "0.8.2";

/**
* Enable Version Checker (if you compile and distribute this yourself, you
Expand Down
22 changes: 3 additions & 19 deletions src/chatty/Irc.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

package chatty;

import chatty.util.DateTime;
import chatty.util.DelayedActionQueue;
import chatty.util.DelayedActionQueue.DelayedActionListener;
import java.net.InetSocketAddress;
Expand Down Expand Up @@ -157,25 +158,7 @@ public String getConnectionInfo() {
}

private String getConnectedSince() {
long duration = (System.currentTimeMillis() - connectedSince) / 1000;
String text = "";
if (duration > 60) {
long minutes = duration / 60;
if (minutes == 1) {
text += minutes + " minute";
}
else {
text += minutes + " minutes";
}
} else {
if (duration == 1) {
text = duration + " second";
}
else {
text = duration + " seconds";
}
}
return text;
return DateTime.ago(connectedSince);
}

/**
Expand All @@ -194,6 +177,7 @@ private String getConnectedSince() {
* @param port The port of the server
* @param nick The nick to connect with
* @param pass The password (required at Twitch)
* @param securedPorts Which ports should be treated as SSL
*/
public final void connect(final String server, final String port,
final String nick, final String pass, Collection<Integer> securedPorts) {
Expand Down
4 changes: 4 additions & 0 deletions src/chatty/gui/components/help/help-addressbook.html
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ <h3><a name="subs-cats">Automatic Subscriber Categories</a></h3>
user to the <code>12months</code> category</li>
<li><code>.. just subscribed!</code> won't do anything</li>
</ul>

<p>Remember that this relies on the notification message to be in a certain
format, so this may not be the most reliable thing, especially if Twitch
decides to change the message in some way.</p>
</body>
</html>

29 changes: 17 additions & 12 deletions src/chatty/gui/components/help/help-guide_folders.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,23 @@ <h3>Settings Directory</h3>
<td>|&nbsp; &nbsp;|-- &lt;various cache files&gt;</td>
<td class="fileComment">Cached emotes/image files</td>
</tr>
<tr>
<td>|-- debuglogs</td>
<td class="fileCommentFolder">[Folder] Files intended to be read
by the user</td>
</tr>
<tr>
<td>|&nbsp; &nbsp;|-- debug_session.log.x</td>
<td class="fileComment">Last session debug log (overwritten every run)</td>
</tr>
<tr>
<td>|&nbsp; &nbsp;|-- debugx.log.x</td>
<td class="fileComment">Rotating debug log</td>
</tr>
<tr>
<td>|&nbsp; &nbsp;|-- debug_ircx.log.x</td>
<td class="fileComment">Rotating raw IRC log (only if enabled)</td>
</tr>
<tr>
<td>|-- exported</td>
<td class="fileCommentFolder">[Folder] Files intended to be read
Expand Down Expand Up @@ -104,18 +121,6 @@ <h3>Settings Directory</h3>
<td>|-- statusPresets</td>
<td class="fileComment">[Settings] Stream Title/Game presets (Admin Dialog)</td>
</tr>
<tr>
<td>|-- debug_session.log.x</td>
<td class="fileComment">Last session debug log (overwritten every run)</td>
</tr>
<tr>
<td>|-- debugx.log.x</td>
<td class="fileComment">Rotating debug log</td>
</tr>
<tr>
<td>|-- debug_ircx.log.x</td>
<td class="fileComment">Rotating raw IRC log (only if enabled)</td>
</tr>

</table>

Expand Down
23 changes: 13 additions & 10 deletions src/chatty/gui/components/help/help-releases.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@ <h1><a name="top">Release Information</a></h1>
full list of changes.</p>

<h2>
<a name="0.8.2">Version 0.8.2</a> <a name="latest">(This one!)</a> (2016-03-10)
<a name="0.8.2">Version 0.8.2</a> <a name="latest">(This one!)</a> (2016-04-26)
<a href="#top" class="top">[back to top]</a>
</h2>
<p>During March Twitch migrated Twitch Chat to new servers (Amazon AWS),
which you probably noticed due to some issues for some third-party
tools. This however also brought some improvements.</p>
tools. This however also brought some improvements:</p>

<ul>
<li>Twitch Chat now supports SSL on ports 6697 and 443
<ul>
<li>Chatty will automatically add these to the default ports if
your port setting is still on the previous default
(otherwise you might have to add it yourself).</li>
(otherwise you might have to add them yourself).</li>
</ul>
</li>
<li>No separate Event Chat servers anymore
Expand All @@ -77,11 +77,12 @@ <h3>Full Changelog</h3>
- Added auto-unhost feature (to unhost when your stream goes live, disabled by
default)
- Added new Twitch Player URL in context menu
- Added feature to automatically add Addressbook categories on Subscriber
- Added feature to automatically add Addressbook categories based on Subscriber
notifications (experimental)
- Added feature to automatically copy messages into clipboard
- Admin Dialog: Added error message for trying to set invalid stream status
- Added context menu entries to directly host channel
- Made URL detection a bit more lenient
- Updated help

System
Expand All @@ -94,14 +95,15 @@ <h3>Full Changelog</h3>
menu bar)
- Moved debug logs into separate directory
- Added /proc command to start native processes out of Chatty
- Made restoring window position a bit more lenient with it being off-screen
- Made restoring window position more lenient for partly off-screen positions

Connection
==========
- Bouncer: Some changes allowing your to connect to a Bouncer
- Whispering: Moved to main chat, hide userlist for Whisper tabs
- Added auto-responses to whispers for ignored/non-whitelisted users (disabled
by default)
- Bouncer: Some changes allowing you to connect to a Bouncer
- Whispers: Moved to main chat (AWS)
- Whispers: Hidden userlist for Whisper tabs by default
- Whispers: Added auto-responses for ignored/non-whitelisted users (disabled by
default)
- Increased max reconnection attempts to 40
- Added `force_verify=true` parameter to Authorize URL (makes Twitch always ask
if you want to Authorize, makes sure you are logged in to the right account)
Expand Down Expand Up @@ -148,7 +150,8 @@ <h3>Full Changelog</h3>
- Check if Java supports opening URLs on the current platform and run native
command if necessary
- Fixed sounds not being closed when finished playing
- Fixed tabs not changing correctly on System Look&Feel
- Fixed tabs not changing correctly on System Look&amp;Feel
- Fixed error on host notification due to moving Whispers to AWS
</pre>

<h2>
Expand Down
3 changes: 3 additions & 0 deletions src/chatty/gui/components/help/help-settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ <h3>General Settings</h3>
<li><strong>Scale</strong>: The relative size of how emotes are displayed in chat (100% is regular size).</li>
<li><strong>Maximum Height</strong>: The maximum height of emotes in chat (in pixels). Use 0 to allow any height.</li>
<li><strong>Emotes Dialog</strong>: The relative size of how emotes are displayed in the Emotes Dialog (100% is regular size).</li>
<li><strong>Double-click on emote closes Emote Dialog</strong>: If
enabled, double-clicking on an emote in the Emote Dialog closes the
Emote Dialog.</li>
</ul>

<h3>Ignored Emotes</h3>
Expand Down
8 changes: 7 additions & 1 deletion src/chatty/gui/components/help/help-troubleshooting.html
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ <h2>
<h3>Run from commandline</h3>
<p>Running Chatty from the commandline has the advantage of being able to
get messages from before the GUI is established. It also may work when Java
isn't integrated into the OS correctly (even when installed).</p>
isn't integrated into the OS correctly (but is installed).</p>

<ol>
<li>Open a commandline window on the directory where the
Expand All @@ -233,6 +233,12 @@ <h3>Run from commandline</h3>
<a href="help-guide_create_shortcut.html">shortcut</a> or a .bat-file to
start Chatty similiar to entering the command above, but much more
conveniently.</p>

<p>If Chatty doesn't start when you enter the above command, check the
commandline window for error messages.
<a href="help.html#contact">Send</a> a screenshot of the commandline
window along with information on what other things you tried if you
require further assistance with it.</p>

<h3>Check Association of .jar with Java (Windows)</h3>
<p>If the integration of Java into the OS may not be correct, and you want
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.8.2b7)</a></h1>
<h1><a name="top">Chatty (Version: 0.8.2)</a></h1>
<table>
<tr>
<td valign="top">
Expand Down
5 changes: 1 addition & 4 deletions src/chatty/gui/components/textpane/ChannelTextPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -1392,6 +1392,7 @@ public void printLine(String line, MutableAttributeSet style) {
* @param text
* @param user
* @param style
* @param emotes
*/
protected void printSpecials(String text, User user, MutableAttributeSet style,
TagEmotes emotes) {
Expand Down Expand Up @@ -1461,10 +1462,6 @@ private void findLinks(String text, Map<Integer, Integer> ranges,
if (!inRanges(start, ranges) && !inRanges(end,ranges)) {
String foundUrl = urlMatcher.group();

if (foundUrl.contains("..")) {
continue;
}

// Check if URL contains ( ) like http://example.com/test(abc)
// or is just contained in ( ) like (http://example.com)
// (of course this won't work perfectly, but it should be ok)
Expand Down
14 changes: 14 additions & 0 deletions src/chatty/util/MiscUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ public static Map<String, String> parseArgs(String[] args) {
return result;
}

/**
* Attempt to move the file atomically, and if that fails try regular file
* replacing.
*
* @param from The file to move
* @param to The target filename, which will be overwritten if it already
* exists
*/
public static void moveFile(Path from, Path to) {
try {
Files.move(from, to, ATOMIC_MOVE);
Expand All @@ -106,6 +114,12 @@ public static void moveFile(Path from, Path to) {
}
}

/**
* Returns the StackTrace of the given Throwable as a String.
*
* @param e
* @return
*/
public static String getStackTrace(Throwable e) {
StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw));
Expand Down

0 comments on commit 04d37ee

Please sign in to comment.