myTeamSpeak: announce the account ID to servers

Signs clientinit with the account's Ed25519 key over the connection
challenge, honours the per-bookmark switch, sends updatemytsid on
sign-in/out, and connects without the ID when myTeamSpeak is unreachable.
Verified live against server.lixko.eu.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-10 20:04:59 +00:00
co-authored by Claude Opus 5.5
parent ca86c510b7
commit 801dfa39ab
14 changed files with 754 additions and 16 deletions
@@ -199,8 +199,11 @@ class SessionController(private val context: Context) {
}
fun connect(bookmark: Bookmark) {
start { it.start(bookmark.address, bookmark.port, bookmark.nickname.orEmpty(), bookmark.password,
bookmark.identityId, bookmark.channel, bookmark.channelPassword) }
start {
it.conn.setMyTeamSpeakFeatures(bookmark.myTeamSpeakFeatures)
it.start(bookmark.address, bookmark.port, bookmark.nickname.orEmpty(), bookmark.password,
bookmark.identityId, bookmark.channel, bookmark.channelPassword)
}
}
private fun start(host: String, port: Int, nickname: String, password: String, identityId: String,
@@ -210,6 +213,7 @@ class SessionController(private val context: Context) {
private fun start(connect: (ServerController) -> Unit) {
val server = ServerController(nextId.incrementAndGet(), this)
server.conn.setMyTeamSpeakLogin(myTeamSpeak)
sessions.add(server.session)
_servers.update { it + server }
_current.value = server
@@ -452,6 +456,7 @@ class SessionController(private val context: Context) {
withContext(Dispatchers.IO) { myTeamSpeak.signIn(email, password) }
.also {
_myTeamSpeakSignedIn.value = true
_servers.value.forEach { it.conn.updateMyTeamSpeak() }
// Shared pictures that could not be had signed out.
pictures.retryFailed()
}
@@ -467,6 +472,7 @@ class SessionController(private val context: Context) {
suspend fun signOutMyTeamSpeak() {
myTeamSpeak.signOut()
_myTeamSpeakSignedIn.value = false
_servers.value.forEach { it.conn.updateMyTeamSpeak() }
withContext(Dispatchers.IO) { attachments.close() }
}