voelin-core: channel moves report why they fail; password and token on connect
A move went out without asking for an answer, so a wrong password or a full channel came back as nothing. It is sent with a return code now, and a refusal comes as Event::JoinFailed: Password, Full, or a sentence for anything else. Moving to the channel we are in says nothing. The UI does not show it yet; the channel password dialog will. VoiceOptions gets channel_password and token, for joining a channel when connecting and for links with a privilege key; tsclientlib's ConnectOptions gets default_token for the latter (UPSTREAM.md patch 15). Live tests on both dev servers check the password and the key on connect, and the refused moves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AVRENKftQqGoEeswiR9TDQ
This commit is contained in:
1 parent
61636b23c8
commit
e441156ee6
6 files changed
+260
-9
No files matched your search
@@ -129,3 +129,7 @@ against or offered back to upstream.
|
||||
Tests cover an independent signature vector, persistence validation/redaction,
|
||||
wire field names, clearing and reconnect snapshot replacement. The account
|
||||
UUID and the ordinary server identity remain separate.
|
||||
15. **Privilege key when connecting** (`tsclientlib/src/lib.rs`, "Voelin patch").
|
||||
`ConnectOptions::default_token` sets `client_default_token` of `clientinit`,
|
||||
which upstream always sent empty, so a privilege key (a bookmark's, or the
|
||||
`token=` of a `ts3server://` link) can be used on connect.
|
||||
@@ -392,6 +392,7 @@ impl Connection {
|
||||
channel: None,
|
||||
channel_password: None,
|
||||
password: None,
|
||||
default_token: None,
|
||||
input_muted: false,
|
||||
output_muted: false,
|
||||
input_hardware_enabled: true,
|
||||
@@ -556,7 +557,7 @@ impl Connection {
|
||||
version_sign: Cow::Borrowed(client_version_sign.as_ref()),
|
||||
client_key_offset: counter,
|
||||
phonetic_name: "".into(),
|
||||
default_token: "".into(),
|
||||
default_token: Cow::Borrowed(options.default_token.as_deref().unwrap_or_default()),
|
||||
hardware_id: Cow::Borrowed(options.hardware_id.as_ref()),
|
||||
badges: None,
|
||||
signed_badges: None,
|
||||
@@ -1730,6 +1731,7 @@ pub struct ConnectOptions {
|
||||
channel: Option<Cow<'static, str>>,
|
||||
channel_password: Option<Cow<'static, str>>,
|
||||
password: Option<Cow<'static, str>>,
|
||||
default_token: Option<Cow<'static, str>>,
|
||||
input_muted: bool,
|
||||
output_muted: bool,
|
||||
input_hardware_enabled: bool,
|
||||
@@ -1944,6 +1946,20 @@ impl ConnectOptions {
|
||||
self
|
||||
}
|
||||
|
||||
/// Use a privilege key (token) when connecting.
|
||||
/// Voelin patch: sent as `client_default_token` in `clientinit`.
|
||||
///
|
||||
/// # Example
|
||||
/// ```
|
||||
/// # use tsclientlib::Connection;
|
||||
/// let opts = Connection::build("localhost").default_token("My privilege key");
|
||||
/// ```
|
||||
#[inline]
|
||||
pub fn default_token<S: Into<Cow<'static, str>>>(mut self, token: S) -> Self {
|
||||
self.default_token = Some(token.into());
|
||||
self
|
||||
}
|
||||
|
||||
/// Connect to the server in a muted state.
|
||||
///
|
||||
/// # Example
|
||||
@@ -2064,6 +2080,10 @@ impl ConnectOptions {
|
||||
#[inline]
|
||||
pub fn get_password(&self) -> Option<&str> { self.password.as_ref().map(AsRef::as_ref) }
|
||||
#[inline]
|
||||
pub fn get_default_token(&self) -> Option<&str> {
|
||||
self.default_token.as_ref().map(AsRef::as_ref)
|
||||
}
|
||||
#[inline]
|
||||
pub fn get_input_muted(&self) -> bool { self.input_muted }
|
||||
#[inline]
|
||||
pub fn get_output_muted(&self) -> bool { self.output_muted }
|
||||
|
||||
Reference in new issue
Block a user