voelin-core: offline messages to the unique id's bytes; voelinctl checks

messageadd carries the recipient's unique id as bytes (base64 on the
wire); the engine passed the base64 text itself, which the server
refused as an invalid client id.

voelinctl engine can now wait for an icon or a flagged poke (listen
--expect matches pokes, chat and icons), for a friend to be seen online
(contacts ls --expect-online), and identity show prints the unique id a
TeamSpeak 6 server knows the identity by (uid6), which offline messages
there need. Contacts commands wait for the stored contacts to load
instead of for an event they could miss.

Verified against 3.13.8 and 6.0.0-beta13.1: file upload, listing,
download, a chat link downloaded by another client, avatars (the a-p
file name on both), channel icons, pokes, private messages, offline
messages, friend presence and blocked pokes (flagged and hidden).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NJvYyRmTjKcb9i8eyYXK5G
This commit is contained in:
Claude committed 2026-09-29 00:51:41 +00:00
1 parent e10c5ba7f4
commit aefe83d33a
3 files changed
+48 -20

No files matched your search

+12 -1
View File
@@ -10,6 +10,7 @@ use std::collections::HashMap;
use std::path::PathBuf;
use std::time::Duration;
use base64::Engine as _;
use futures::prelude::*;
use tokio::sync::{broadcast, mpsc};
use tokio::task::AbortHandle;
@@ -861,7 +862,17 @@ impl Voice {
self.send(cmd, Pending::OfflineGet { request, id, message: None })?;
}
VoiceCmd::OfflineAdd { request, to_uid, subject, text } => {
let uid = tsclientlib::UidBuf(to_uid.into_bytes());
// The command carries the unique id's bytes (base64 on the wire).
let bytes = base64::engine::general_purpose::STANDARD
.decode(to_uid.trim())
.map_err(|_| anyhow::anyhow!("offline message: invalid unique id {to_uid:?}"));
let uid = match bytes {
Ok(bytes) => tsclientlib::UidBuf(bytes),
Err(e) => {
self.link.done(request, Err(e.to_string()));
return Ok(());
}
};
let cmd = c2s::OutOfflineMessageAddMessage::new(&mut std::iter::once(
c2s::OutOfflineMessageAddPart {
client_uid: std::borrow::Cow::Borrowed(uid.as_ref()),