Use current channel topology for admin property readback
This commit is contained in:
1 parent
981c486b0c
commit
be1d308f9e
5 files changed
+34
-11
No files matched your search
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
- Channel information and lists now show the current parent and preceding sibling after a neighboring channel moves.
|
||||||
|
|
||||||
- The server view now names the legacy Speex or CELT codec of the joined channel when voice is unavailable. Browsing another channel does not change the warning. The native transmission gate requires a known Opus codec.
|
- The server view now names the legacy Speex or CELT codec of the joined channel when voice is unavailable. Browsing another channel does not change the warning. The native transmission gate requires a known Opus codec.
|
||||||
|
|
||||||
- Reapplying direct voice transmission no longer ends an active burst or invalidates captured frames. Switching between direct transmission and voice activation still invalidates the old capture epoch.
|
- Reapplying direct voice transmission no longer ends an active burst or invalidates captured frames. Switching between direct transmission and voice activation still invalidates the old capture epoch.
|
||||||
|
|||||||
@@ -15,11 +15,14 @@ impl Session {
|
|||||||
admin::AdminCommand::Context => (menu::command("permissionlist", &[]), admin::Reply::Context),
|
admin::AdminCommand::Context => (menu::command("permissionlist", &[]), admin::Reply::Context),
|
||||||
admin::AdminCommand::Extra(admin::extra::Command::ChannelList {}) => {
|
admin::AdminCommand::Extra(admin::extra::Command::ChannelList {}) => {
|
||||||
let rows: Vec<_> = snapshot::ordered_channels(&book.channels).into_iter()
|
let rows: Vec<_> = snapshot::ordered_channels(&book.channels).into_iter()
|
||||||
.filter_map(|(id, _)| c.extras.channel_properties(id.0).cloned()).collect();
|
.filter_map(|(id, _)| {
|
||||||
|
let channel = book.channels.get(&id)?;
|
||||||
|
c.extras.channel_properties(id, channel.parent, channel.order)
|
||||||
|
}).collect();
|
||||||
if rows.len() != book.channels.len() {
|
if rows.len() != book.channels.len() {
|
||||||
return Err(ErrorObj::new(ErrorCode::ServerError, "channel properties are incomplete; wait for the server channel list"));
|
return Err(ErrorObj::new(ErrorCode::ServerError, "channel properties are incomplete; wait for the server channel list"));
|
||||||
}
|
}
|
||||||
return Ok(Some(json!({ "rows": rows })));
|
return Ok(Some(Value::from_iter([("rows", Value::Array(rows))])));
|
||||||
}
|
}
|
||||||
admin::AdminCommand::Extra(admin::extra::Command::ChannelInfo { channel_id }) => {
|
admin::AdminCommand::Extra(admin::extra::Command::ChannelInfo { channel_id }) => {
|
||||||
if !book.channels.contains_key(&ChannelId(*channel_id)) {
|
if !book.channels.contains_key(&ChannelId(*channel_id)) {
|
||||||
@@ -69,8 +72,10 @@ impl Session {
|
|||||||
let answer = match (reply, res) {
|
let answer = match (reply, res) {
|
||||||
(admin::Reply::Context, res) => self.admin_context(res),
|
(admin::Reply::Context, res) => self.admin_context(res),
|
||||||
(admin::Reply::ChannelInfo { channel_id }, Ok(())) => {
|
(admin::Reply::ChannelInfo { channel_id }, Ok(())) => {
|
||||||
self.conn.as_ref().and_then(|c| c.extras.channel_properties(channel_id))
|
self.conn.as_ref().and_then(|c| {
|
||||||
.map(|row| json!({ "rows": [row] }))
|
let channel = c.con.get_state().ok()?.channels.get(&ChannelId(channel_id))?;
|
||||||
|
c.extras.channel_properties(channel.id, channel.parent, channel.order)
|
||||||
|
}).map(|row| Value::from_iter([("rows", Value::Array(vec![row]))]))
|
||||||
.ok_or_else(|| ErrorObj::new(ErrorCode::NotFound, "channel disappeared before its properties were read"))
|
.ok_or_else(|| ErrorObj::new(ErrorCode::NotFound, "channel disappeared before its properties were read"))
|
||||||
}
|
}
|
||||||
(admin::Reply::Rows { notify: "notifyserverupdated", overflow: false, .. }, Ok(())) => {
|
(admin::Reply::Rows { notify: "notifyserverupdated", overflow: false, .. }, Ok(())) => {
|
||||||
|
|||||||
+20
-6
@@ -65,10 +65,8 @@ struct ChannelExtra {
|
|||||||
impl ChannelExtra {
|
impl ChannelExtra {
|
||||||
fn merge(&mut self, item: &BTreeMap<String, String>) {
|
fn merge(&mut self, item: &BTreeMap<String, String>) {
|
||||||
for (key, value) in item {
|
for (key, value) in item {
|
||||||
if key.starts_with("channel_") || matches!(key.as_str(), "cid" | "cpid") {
|
if key == "cid" || (key.starts_with("channel_") && key != "channel_order") {
|
||||||
self.properties.insert(key.clone(), value.clone());
|
self.properties.insert(key.clone(), value.clone());
|
||||||
} else if key == "order" {
|
|
||||||
self.properties.insert("channel_order".into(), value.clone());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if let Some(u) = item.get("channel_banner_gfx_url") {
|
if let Some(u) = item.get("channel_banner_gfx_url") {
|
||||||
@@ -157,9 +155,14 @@ fn non_empty(s: &str) -> Option<String> { (!s.is_empty()).then(|| s.to_owned())
|
|||||||
|
|
||||||
impl RawExtras {
|
impl RawExtras {
|
||||||
pub fn server_properties(&self) -> &BTreeMap<String, String> { &self.server_properties }
|
pub fn server_properties(&self) -> &BTreeMap<String, String> { &self.server_properties }
|
||||||
/// Ordinary channel fields observed on this connection, not a ServerQuery snapshot.
|
/// The book also relinks siblings that did not receive an individual move notification.
|
||||||
pub fn channel_properties(&self, channel_id: u64) -> Option<&BTreeMap<String, String>> {
|
pub fn channel_properties(&self, channel_id: ChannelId, parent: ChannelId, order: ChannelId) -> Option<Value> {
|
||||||
self.channels.get(&channel_id).map(|c| &c.properties)
|
let fields = &self.channels.get(&channel_id.0)?.properties;
|
||||||
|
let mut row = serde_json::Map::with_capacity(fields.len() + 2);
|
||||||
|
row.extend(fields.iter().map(|(k, v)| (k.clone(), Value::String(v.clone()))));
|
||||||
|
row.insert("cpid".into(), Value::String(parent.0.to_string()));
|
||||||
|
row.insert("channel_order".into(), Value::String(order.0.to_string()));
|
||||||
|
Some(Value::Object(row))
|
||||||
}
|
}
|
||||||
/// myTeamSpeak avatar URLs of a client (`(variant, url)`), empty if none.
|
/// myTeamSpeak avatar URLs of a client (`(variant, url)`), empty if none.
|
||||||
pub fn client_myts_avatars(&self, client_id: u16) -> &[(u32, String)] {
|
pub fn client_myts_avatars(&self, client_id: u16) -> &[(u32, String)] {
|
||||||
@@ -516,6 +519,17 @@ mod tests {
|
|||||||
use super::*;
|
use super::*;
|
||||||
use crate::rawcmd;
|
use crate::rawcmd;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn channel_readback_uses_current_sibling_position_and_retains_extra_fields() {
|
||||||
|
let mut extras = RawExtras::default();
|
||||||
|
extras.apply(&rawcmd::parse(b"channellist cid=8 cpid=2 channel_order=3 channel_name=Music channel_banner_mode=2").unwrap());
|
||||||
|
extras.apply(&rawcmd::parse(b"notifychanneledited cid=8 channel_topic=Updated").unwrap());
|
||||||
|
let row = extras.channel_properties(ChannelId(8), ChannelId(0), ChannelId(7)).unwrap();
|
||||||
|
assert_eq!(row, json!({"cid":"8", "cpid":"0", "channel_order":"7", "channel_name":"Music", "channel_banner_mode":"2", "channel_topic":"Updated"}));
|
||||||
|
extras.apply(&rawcmd::parse(b"notifychanneldeleted cid=8").unwrap());
|
||||||
|
assert!(extras.channel_properties(ChannelId(8), ChannelId(0), ChannelId(0)).is_none());
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn file_backend_and_snapshot_follow_complete_capability_announcements() {
|
fn file_backend_and_snapshot_follow_complete_capability_announcements() {
|
||||||
use crate::file_transfer::{Files, ListBackend};
|
use crate::file_transfer::{Files, ListBackend};
|
||||||
|
|||||||
+1
-1
@@ -671,7 +671,7 @@ For an isolated Windows beta14 fixture at `127.0.0.1:19987`, set `TEAMSPEACH_QA_
|
|||||||
| `channel_delete` | `{generation,channel_id,force,confirm}`; confirm exact current channel name |
|
| `channel_delete` | `{generation,channel_id,force,confirm}`; confirm exact current channel name |
|
||||||
| `channel_subscribe` / `channel_subscribe_all` | `{channel_id,subscribe}` / `{subscribe}` |
|
| `channel_subscribe` / `channel_subscribe_all` | `{channel_id,subscribe}` / `{subscribe}` |
|
||||||
| `channel_description` | `{channel_id}` → `{description}` |
|
| `channel_description` | `{channel_id}` → `{description}` |
|
||||||
| `channel_list` / `channel_info` | `{}` / `{channel_id}`; observed channel wire properties, info refreshes description |
|
| `channel_list` / `channel_info` | `{}` / `{channel_id}`; observed channel properties, with `cpid` and `channel_order` taken from the current channel tree as decimal strings; info refreshes description |
|
||||||
| `client_info` | `{client_id,uid}`; checks current UID, requests `clientgetvariables` |
|
| `client_info` | `{client_id,uid}`; checks current UID, requests `clientgetvariables` |
|
||||||
| `set_away` | `{away,message?}`; message only when away, ≤80 characters |
|
| `set_away` | `{away,message?}`; message only when away, ≤80 characters |
|
||||||
| `talk_request` | `{request,message?}`; message only when requesting, ≤50 characters |
|
| `talk_request` | `{request,message?}`; message only when requesting, ≤50 characters |
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
## Возврат к разработке на ПК, 2026-11-26
|
## Возврат к разработке на ПК, 2026-11-26
|
||||||
|
|
||||||
|
Windows, база `981c486`: ответы `channel_list` и `channel_info` берут родителя и предыдущий соседний канал из актуальной модели дерева. Адресный тест `channel_readback_uses_current_sibling_position_and_retains_extra_fields` прошёл: сохранены дополнительные свойства, позиция обновлена, удалённый канал не возвращается. Живое перемещение и показ позиции в окне в этом прогоне не проверялись.
|
||||||
|
|
||||||
Windows, база `827f2c3`: окно сервера показывает название Speex/CELT по текущему каналу открытой вкладки. Прошли `codec_warning_follows_joined_channel_on_viewed_tab` и `legacy_codecs_neither_select_an_encoder_nor_enter_the_mix`. Снимки для окна тестовые; пункт живого входа в legacy-канал остаётся открытым.
|
Windows, база `827f2c3`: окно сервера показывает название Speex/CELT по текущему каналу открытой вкладки. Прошли `codec_warning_follows_joined_channel_on_viewed_tab` и `legacy_codecs_neither_select_an_encoder_nor_enter_the_mix`. Снимки для окна тестовые; пункт живого входа в legacy-канал остаётся открытым.
|
||||||
|
|
||||||
Windows, база `ced85a3`: при отзыве захвата менеджер один раз инвалидирует каждое затронутое ядро; инвалидация сама ставит маркер конца реплики. Два теста нативного менеджера и три теста очереди и буфера VAD прошли. Запоздалое подтверждение не восстановило отозванный маршрут, новое подтверждение разрешило следующий кадр. Это проверка встроенного ядра, не измерение сетевого или акустического окончания реплики.
|
Windows, база `ced85a3`: при отзыве захвата менеджер один раз инвалидирует каждое затронутое ядро; инвалидация сама ставит маркер конца реплики. Два теста нативного менеджера и три теста очереди и буфера VAD прошли. Запоздалое подтверждение не восстановило отозванный маршрут, новое подтверждение разрешило следующий кадр. Это проверка встроенного ядра, не измерение сетевого или акустического окончания реплики.
|
||||||
|
|||||||
Reference in new issue
Block a user