Show clients' country flags beside their names, and optionally in the tree

The server places each client in a country (client_country, from its GeoIP
database); a client's details now show that country's flag left of their
name, as TeamSpeak's info frame does, on both clients. "Show country flags
in the channel tree" (off by default, as TeamSpeak's EnableCountryFlags)
also puts it last on client rows.

The flags are TeamSpeak's countries.zip, which now ships with the icon
packs; core's CountryFlags reads it, else a TeamSpeak 3 install's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-30 23:40:44 +00:00
co-authored by Claude Opus 5.5
parent 4ca5534ef4
commit e799218444
20 changed files with 256 additions and 19 deletions
@@ -0,0 +1,22 @@
package com.ts3client.gfx;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
class CountryFlagsTest {
@Test
void namesCountriesInEnglishAndLeavesOddCodesAsTheyAre() {
assertEquals("Slovakia", CountryFlags.name("SK"));
assertEquals("Germany", CountryFlags.name("de"));
assertEquals("not a code", CountryFlags.name("not a code"));
}
@Test
void hasNoFlagForNoCountry() {
assertNull(CountryFlags.png(""));
assertNull(CountryFlags.png(null));
}
}