Show the myTeamSpeak ID, UUID and creation date in the account tab

The ID is the account's base32 myTeamSpeak ID: the localpart of its chat
ID and the user the myTeamSpeak file API addresses. All three come from
the sign-in reply already fetched, on desktop and Android.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-09 08:03:59 +00:00
co-authored by Claude Opus 5.5
parent 023b449fba
commit 1bb788b501
6 changed files with 160 additions and 4 deletions
@@ -0,0 +1,33 @@
package com.ts3client.myts;
import org.junit.jupiter.api.Test;
import java.nio.charset.StandardCharsets;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
class AccountInfoTest {
private static String base32(String text) {
return AccountInfo.base32(text.getBytes(StandardCharsets.US_ASCII));
}
@Test
void encodesRfc4648VectorsLowercaseAndUnpadded() {
assertEquals("", base32(""));
assertEquals("my", base32("f"));
assertEquals("mzxq", base32("fo"));
assertEquals("mzxw6", base32("foo"));
assertEquals("mzxw6yq", base32("foob"));
assertEquals("mzxw6ytb", base32("fooba"));
assertEquals("mzxw6ytboi", base32("foobar"));
}
@Test
void toleratesAReplyWithoutIdentityData() {
AccountInfo info = AccountInfo.of("tester", "u", null, 0);
assertEquals("", info.userId());
assertNull(info.created());
}
}
@@ -48,7 +48,11 @@ class MyTeamSpeakTest {
.bytes(1, MyTsCryptoTest.KEY_PACKAGE)
.string(2, SESSION)
.varint(5, 200)
.string(4, "828613f7-3cde-45e6-993e-c57ee979a39f")
.string(8, "tester")
.message(9, new ProtobufWriter().varint(3, 1_770_000_000L)
.bytes(4, java.util.HexFormat.of().parseHex(
"0120b05c4b1a2d3e4f5061728394a5b6c7d8e9f00112233445566778899aabbccd")))
.toByteArray();
}
@@ -82,6 +86,9 @@ class MyTeamSpeakTest {
MyTeamSpeak.Account account = new MyTeamSpeak(server).download(credentials(MyTsCryptoTest.PASSWORD));
assertEquals("tester", account.username());
assertEquals("828613f7-3cde-45e6-993e-c57ee979a39f", account.info().uuid());
assertEquals(java.time.Instant.ofEpochSecond(1_770_000_000L), account.info().created());
assertEquals("aeqlaxcldiwt4t2qmfzihfffw3d5r2pqaejcgncfkztxrcm2vo6m2", account.info().userId());
assertEquals(1, account.items().size());
SyncItem.Bookmark bookmark = assertInstanceOf(SyncItem.Bookmark.class, account.items().get(0));
assertEquals("server.lixko.eu", bookmark.address());