diff --git a/src/chatty/StatusHistory.java b/src/chatty/StatusHistory.java index fdb115618..78a528516 100644 --- a/src/chatty/StatusHistory.java +++ b/src/chatty/StatusHistory.java @@ -5,11 +5,9 @@ import chatty.util.settings.SettingsListener; import java.util.ArrayList; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.Set; import java.util.logging.Logger; /** diff --git a/src/chatty/TwitchConnection.java b/src/chatty/TwitchConnection.java index 021427801..de12daa45 100644 --- a/src/chatty/TwitchConnection.java +++ b/src/chatty/TwitchConnection.java @@ -927,7 +927,7 @@ void onNotice(String nick, String from, String text) { return; } // Should only be from the server for now - listener.onInfo("[Notice] " + text); + listener.onNotice(text); } @Override @@ -954,7 +954,7 @@ void onQueryMessage(String nick, String from, String text) { listener.onSpecialMessage(nick, text); } if (nick.equals("jtv")) { - infoMessage(null, text); + listener.onInfo("[Info] "+text); } } @@ -1272,9 +1272,27 @@ public interface ConnectionListener { void onNotice(String message); + /** + * An info message to a specific channel, usually intended to be + * directly output to the user. + * + *

The channel should not be null. If no channel is associated, use + * {@link onInfo(String) onInfo(infoMessage)} instead.

+ * + * @param channel The channel the info message belongs to + * @param infoMessage The info message + */ void onInfo(String channel, String infoMessage); - void onInfo(String message); + /** + * An info message, usually intended to be directly output to the user. + * + *

Since no channel is associated, this is likely to be output to the + * currently active channel/tab.

+ * + * @param infoMessage The info message + */ + void onInfo(String infoMessage); void onGlobalInfo(String message); diff --git a/src/chatty/gui/components/help/help-bouncer.html b/src/chatty/gui/components/help/help-bouncer.html index 3f1812fad..b16a989e1 100644 --- a/src/chatty/gui/components/help/help-bouncer.html +++ b/src/chatty/gui/components/help/help-bouncer.html @@ -59,9 +59,10 @@

Configuring the Bouncer

CAP REQ :twitch.tv/tags CAP REQ :twitch.tv/commands -

To receive a userlist at all, you also need to send (Twitch Chat will - only send the userlist on join and under some circumstances it may not - send a userlist at all):

+

To receive a userlist at all, you also need to send the following (even + then Twitch Chat will only send the userlist on join and then update it + via JOINs/PARTs, and under some circumstances it may not send a userlist + at all):

 CAP REQ :twitch.tv/membership
@@ -78,9 +79,8 @@

Notes

  • The Channel State (Subonly, Slowmode, ..) won't always be correct because the Bouncer won't send the state on join if the channel is already joined on the Bouncer.
  • -
  • Connecting to the Whisper servers directly won't work since that - connection will try to use the same password as you set for the - Bouncer.
  • +
  • Receiving Whispers may not work, depending on whether the Bouncer + forwards the WHISPER command to Chatty.
  • diff --git a/src/chatty/gui/components/help/help-guide_create_shortcut.html b/src/chatty/gui/components/help/help-guide_create_shortcut.html index bbec5d2c6..93c0e8741 100644 --- a/src/chatty/gui/components/help/help-guide_create_shortcut.html +++ b/src/chatty/gui/components/help/help-guide_create_shortcut.html @@ -6,18 +6,21 @@

    Create Shortcut and add Icon

    -

    This applies to Windows 7, not sure about other OS.

    +

    This applies to Windows 7, and probably other Windows versions. The info + can probably also be applied to other OS with some adjustments.

    You can create a shortcut for Chatty, which has some potential advantages (depending on what you need):

    Create shortcut

    Create a shortcut to Java to start Chatty (for this example the diff --git a/src/chatty/gui/components/help/help-releases.html b/src/chatty/gui/components/help/help-releases.html index 9705a72e0..93bf9b1d8 100644 --- a/src/chatty/gui/components/help/help-releases.html +++ b/src/chatty/gui/components/help/help-releases.html @@ -55,8 +55,18 @@

    (otherwise you might have to add it yourself). -
  • No separate Event Chat servers anymore
  • -
  • Whispers (and Group Chat) got moved to AWS early April
  • +
  • No separate Event Chat servers anymore + +
  • +
  • Whispers (and Group Chat) got moved to AWS early April + +
  • Full Changelog

    @@ -66,35 +76,44 @@

    Full Changelog

    - Added some account info to User Info Dialog (click on "More..") - Added auto-unhost feature (to unhost when your stream goes live, disabled by default) -- Added single-instance mode, with the ability to join channels in the already - running instance -- Emote Dialog: Improved displayed info a bit -- 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) - Added new Twitch Player URL in context menu -- Added /emoteonly and /emoteonlyoff commands (in case they get enabled again) -- Added "emotesets" parameter to /refresh command -- Changed twitchemotes.com API URL (which is the source of emoteset information) -- Added some support for selecting the correct chat server -- Added auto-responses to whispers for ignored/non-whitelisted users (disabled - by default) - Added feature to automatically add Addressbook categories on Subscriber notifications (experimental) - Added feature to automatically copy messages into clipboard -- Moved debug logs into separate directory -- Increased max reconnection attempts to 40 -- Admin Dialog: Added error message for tryint to set invalid stream status +- Admin Dialog: Added error message for trying to set invalid stream status +- Added context menu entries to directly host channel +- Updated help + +System +====== +- Added single-instance mode, with the ability to join channels in the already + running instance - Added in-app announcements (Help - Announcements), for more reliable communication of relevant news about Chatty (if new announcement is available a window will pop up on start and a notification will be shown in the main menu bar) +- Moved debug logs into separate directory - Added /proc command to start native processes out of Chatty -- Added context menu entries to directly host channel -- ShortenDisplayOfExcessivelyLongEmoteCodesLookingOutTheirWindow -- Bouncer: Some changes allowing connection to a Bouncer - Made restoring window position a bit more lenient with it being off-screen + +Connection +========== +- Bouncer: Some changes allowing your to connect to a Bouncer - Whispering: Moved to main chat, hide userlist for Whisper tabs -- Updated help +- Added auto-responses to whispers 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) +- Added some support for selecting the correct chat server + +Emotes +====== +- Emote Dialog: Improved shown info a bit +- Added /emoteonly and /emoteonlyoff commands (in case they get enabled again) +- Added "emotesets" parameter to /refresh command +- Changed twitchemotes.com API URL (which is the source of emoteset information) +- ShortenDisplayOfExcessivelyLongEmoteCodesLookingOutTheirWindow Settings ======== @@ -128,6 +147,8 @@

    Full Changelog

    prevents high CPU usage (displaying animated GIFs in Java is hard) - 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

    diff --git a/src/chatty/gui/components/help/help-settings.html b/src/chatty/gui/components/help/help-settings.html index 2ebe5cdb0..9ba61c381 100644 --- a/src/chatty/gui/components/help/help-settings.html +++ b/src/chatty/gui/components/help/help-settings.html @@ -100,10 +100,9 @@

    Other

    SimpleDateFormat class.
  • Show mod/unmod messages: Whether to show the MOD/UNMOD - messages as they come in from Twitch Chat (which are used to show the - moderator badge). These messages can be sometimes - be kind of broken (on Twitch's side) and can show some or all mods in the channel - as being modded/unmodded.
  • + messages as they come in from Twitch Chat. These messages are send + not only when someone was modded/unmodded but also when a mod joins + or leaves the chat.
  • Show joins/parts: Show joins/parts, which are always kind of delayed, so don't take them too seriously (only works when Advanced - Correct Userlist is enabled).
  • diff --git a/src/chatty/gui/components/help/help-troubleshooting.html b/src/chatty/gui/components/help/help-troubleshooting.html index 500ab9093..241705c60 100644 --- a/src/chatty/gui/components/help/help-troubleshooting.html +++ b/src/chatty/gui/components/help/help-troubleshooting.html @@ -207,20 +207,44 @@

    If you are sure that the Chatty.jar is actually started with Java, but no program window appears, it may be that an error occured before the window (GUI) could be created.

    + +

    Run from commandline

    +

    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).

    + +
      +
    1. Open a commandline window on the directory where the + Chatty.jar is located + +
    2. +
    3. In the commandline window, enter java -jar Chatty.jar + and press Enter.
    4. +
    + +

    When you enter the above command and Chatty starts correctly (but doesn't + when you double-click the Chatty.jar), this may mean that + Java isn't integrated into the OS properly. You can create a + shortcut or a .bat-file to + start Chatty similiar to entering the command above, but much more + conveniently.

    Check Association of .jar with Java (Windows)

    +

    If the integration of Java into the OS may not be correct, and you want + to try to fix it, you can try this.

    +

    Open a commandline window and enter assoc .jar which should output .jar=jarfile and enter ftype jarfile which should output something like "C:\Program Files\Java\jre7\bin\javaw.exe" -jar "%1" %* (see also Could not find the main class. Program will exit.)

    -

    Run from commandline

    -

    Running Chatty from the commandline has the advantage of being able to - get messages from before the GUI is established. Open a commandline where - the Chatty.jar is located (Win7/8: Hold Shift while Right-Clicking to open - the context menu, click Open command window here) and enter - java -jar Chatty.jar.

    +

    Error: Java is not recognized as an internal or external command (Windows)

    If you experience this when entering java -jar Chatty.jar diff --git a/src/chatty/gui/components/settings/MessageSettings.java b/src/chatty/gui/components/settings/MessageSettings.java index 78008fdb0..cb4fa4710 100644 --- a/src/chatty/gui/components/settings/MessageSettings.java +++ b/src/chatty/gui/components/settings/MessageSettings.java @@ -93,7 +93,8 @@ public void actionPerformed(ActionEvent e) { gbc.anchor = GridBagConstraints.WEST; otherSettingsPanel.add( d.addSimpleBooleanSetting("showModMessages", "Show mod/unmod messages", - "Whether to show when someone was modded/unmodded."), + "Whether to show when someone was modded/unmodded or a " + + "mod joined/left the channel."), gbc); gbc = d.makeGbc(2, 1, 2, 1); diff --git a/src/chatty/gui/components/tabs/Tabs.java b/src/chatty/gui/components/tabs/Tabs.java index 2d3ed2f7e..db9a4019d 100644 --- a/src/chatty/gui/components/tabs/Tabs.java +++ b/src/chatty/gui/components/tabs/Tabs.java @@ -49,6 +49,8 @@ public enum TabOrder { private TabOrder order = TabOrder.INSERTION; + private JPopupMenu popupMenu; + public Tabs() { setLayout(new BorderLayout()); tabs.setOpaque(false); @@ -75,17 +77,34 @@ public void mouseWheelMoved(MouseWheelEvent e) { @Override public void mousePressed(MouseEvent e) { - /** - * Switch to clicked tab. - */ - int index = tabs.indexAtLocation(e.getX(), e.getY()); - if (index != -1) { - tabs.setSelectedIndex(index); - } + openPopupMenu(e); } + @Override + public void mouseReleased(MouseEvent e) { + openPopupMenu(e); + } }); - //tabs.setTabPlacement(JTabbedPane.LEFT); + } + + /** + * Open context menu manually instead of relying on the JTabbedPane, so we + * can check if it's the currently selected tab (since the context menu will + * trigger actions based on the currently selected tab). + * + * @param e + */ + private void openPopupMenu(MouseEvent e) { + if (!e.isPopupTrigger()) { + return; + } + if (popupMenu == null) { + return; + } + final int index = tabs.indexAtLocation(e.getX(), e.getY()); + if (tabs.getSelectedIndex() == index) { + popupMenu.show(tabs, e.getX(), e.getY()); + } } private boolean isNearLastTab(Point p) { @@ -103,7 +122,7 @@ public void setMouseWheelScrollingAnywhereEnabled(boolean enabled) { } public void setPopupMenu(JPopupMenu menu) { - tabs.setComponentPopupMenu(menu); + popupMenu = menu; } /** diff --git a/src/chatty/util/Webserver.java b/src/chatty/util/Webserver.java index 8663c8b4e..bffb5db08 100644 --- a/src/chatty/util/Webserver.java +++ b/src/chatty/util/Webserver.java @@ -119,16 +119,21 @@ public void run() { try { clientSocket = serverSocket.accept(); } catch (SocketException ex) { - debug("Accept interrupted: "+ex.getLocalizedMessage()); + debug("Accept interrupted: "+ex); // After breaking out of the loop, there is a close() anyway //close(); break; } catch (IOException ex) { - debug("ServerSocket accept failed: "+ex.getLocalizedMessage()); + debug("ServerSocket accept failed: "+ex); // TODO: close() necessary? // Why return instead of break? //return; break; + } catch (NullPointerException ex) { + // serverSocket apparently may be null in some circumstances + // (possibly a race condition when stopping the server), if so + // just stop + break; } // Connection established, work with it newConnection(clientSocket); @@ -232,11 +237,8 @@ public void run() { if (request != null) { respond(request); } - - } catch (SocketTimeoutException ex) { - debugConnection("SoTimeout: "+ex.getLocalizedMessage()); } catch (IOException ex) { - debugConnection("Error reading: "+ex.getLocalizedMessage()); + debugConnection("Error reading: "+ex); } debugConnection("Closed"); }