Show pictures in descriptions, or links to them when turned off

[img] in a channel, client or server description is now a picture on both
clients, as TeamSpeak shows it; chat keeps it a link. Only web addresses
become pictures. While one loads it is TeamSpeak's loading icon; one that
cannot be had is its address behind the broken-picture icon.

"Show pictures in descriptions" (desktop: Chat settings; Android: Appearance)
turns them into links behind a picture icon instead, fetching nothing. A
picture that was itself a link keeps that link beside it.

Core's PictureDownloads fetches them for both clients: kept on disk for a
month after last shown, at most 8 MB, redirects followed across http and
https, and on Android plain http asked for over https. The desktop draws
them narrowed to the info panel, Android at a pixel to a dp, animated GIFs
playing on both; long addresses are shortened to host and file name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-30 23:06:13 +00:00
parent fd86d9e638
commit af0564702e
19 changed files with 805 additions and 68 deletions

View File

@@ -12,6 +12,7 @@ import javax.swing.JPanel;
import javax.swing.JTextField;
import java.awt.BorderLayout;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import java.io.File;
/**
@@ -24,6 +25,7 @@ final class ChatLogsPanel extends FormPanel {
private final JCheckBox enabled = new JCheckBox("Keep chat logs");
private final JTextField folder = new JTextField(18);
private final JButton browse = new JButton("Browse…");
private final JCheckBox pictures = new JCheckBox("Show pictures in descriptions");
ChatLogsPanel(Settings settings) {
this.settings = settings;
@@ -50,9 +52,17 @@ final class ChatLogsPanel extends FormPanel {
c.gridy = 2;
c.gridx = 1;
c.weighty = 1;
c.anchor = GridBagConstraints.NORTHWEST;
add(new JLabel("Takes effect on the next connect."), c);
pictures.setSelected(settings.descriptionPictures);
pictures.setToolTipText("Off: only links to them, nothing fetched");
c.gridy = 3;
c.gridx = 0;
c.gridwidth = 2;
c.weighty = 1;
c.insets = new Insets(UIScale.scale(12), c.insets.left, c.insets.bottom, c.insets.right);
add(pictures, c);
updateEnabled();
}
@@ -76,5 +86,6 @@ final class ChatLogsPanel extends FormPanel {
void apply() {
settings.chatLogs = enabled.isSelected();
settings.chatLogDir = folder.getText().trim();
settings.descriptionPictures = pictures.isSelected();
}
}