Tabbed chats with BBCode rendering and clickable identities

Replace the chat target dropdown with a tab strip along the bottom of the
chat panel: a Server and a Channel tab plus one closable tab per private
chat, each with its own log and an unread marker.

Render logs and channel/client descriptions as HTML through a new BBCode
renderer in core, supporting b/i/u/s, color, size, url, center and lists,
with auto-linked bare URLs. Input is escaped and tag values validated, so
server-supplied text cannot inject markup or unsafe schemes.

Sender names and TeamSpeak's own client:// links open the same context menu
as the server tree (menus extracted into ClientMenu/ChannelMenu); channel://
links open the channel menu. Links are styled by CSS class: identities bold
in the author colour, other TS protocols plain, and links leaving the client
underlined so they cannot be mistaken for an identity.

Dragging a client or channel out of the tree yields the TS3 link BBCode.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-13 13:50:04 +00:00
parent a69b7bde74
commit 707d9ebbba
11 changed files with 800 additions and 103 deletions

View File

@@ -0,0 +1,27 @@
package com.ts3client.ui;
import javax.swing.JOptionPane;
import java.awt.Component;
import java.awt.Desktop;
import java.net.URI;
/** Opens http(s) links from chat messages and descriptions in the system browser. */
final class Links {
private Links() {
}
static void open(String href, Component parent) {
try {
URI uri = new URI(href);
String scheme = uri.getScheme() == null ? "" : uri.getScheme().toLowerCase();
if (!scheme.equals("http") && !scheme.equals("https") && !scheme.equals("ftp")) return;
if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) {
Desktop.getDesktop().browse(uri);
return;
}
} catch (Exception ignored) {
}
JOptionPane.showInputDialog(parent, "Could not open the link. Copy it instead:", href);
}
}