feat: fix voice join/leave, channel edit defaults, channel-update stream restart
Three bugs fixed across the full stack (proto/server/core/ABI/Win/macOS/iOS): 1. Join/Leave Voice now truly subscribes/unsubscribes from the voice plane. Previously the button only toggled the local mic — receiving was always on (gated by channel membership alone). Added a protocol-level voice subscription concept: new SubscribeVoiceRequest/UnsubscribeVoiceRequest/VoiceSubscriptionResult proto messages, User.voice_subscribed field, vc_join_voice/vc_leave_voice C ABI functions, VC_EVENT_VOICE_STATE event, server-side voice_subscribed flag checked by the SFU relay recipient filter, and core-client gating of remote-stream decoder setup. All three clients rewired to subscribe+mic on Join / unsubscribe on Leave. Text chat works regardless of voice subscription. 2. Channel edit dialog now shows the channel's actual current settings. The read struct vc_channel was missing sort_order and audio fields — only the write struct vc_channel_info had them. Extended vc_channel with both (additive, no ABI break), updated the session model and list_channels marshaling to populate them, and updated all three clients' edit callers to use actual channel info instead of hardcoded defaults. 3. Channel parameter updates now automatically restart everyone's streams. Previously editing a channel's audio config persisted and broadcast a ChannelEvent::UPDATED, but no layer restarted streams — encoders/decoders are frozen at announce time. handle_channel_event now detects audio-config changes on the user's current channel and stop->starts each active local stream. The server reads the updated config on re-announce; peers wire up fresh decoders at the new ssrc. All 29 CTest tests pass; Windows DLL + C# client build clean. Apple clients not yet compile-verified (Windows environment).
This commit is contained in:
@@ -44,6 +44,9 @@ message Envelope {
|
||||
StreamStop stream_stop = 42;
|
||||
StreamStateUpdate stream_state = 43;
|
||||
UdpBinding udp_binding = 44;
|
||||
SubscribeVoiceRequest subscribe_voice = 45;
|
||||
UnsubscribeVoiceRequest unsubscribe_voice = 46;
|
||||
VoiceSubscriptionResult voice_subscription_result = 47;
|
||||
|
||||
// Text (50–59)
|
||||
TextMessage text_message = 50;
|
||||
@@ -120,6 +123,7 @@ message User {
|
||||
bool server_muted = 7;
|
||||
repeated StreamInfo streams = 8;
|
||||
bool server_deafened = 9; // M5: server-imposed deafen
|
||||
bool voice_subscribed = 10; // true when the user is on the voice plane (hears + can send)
|
||||
}
|
||||
|
||||
message Permissions {
|
||||
@@ -216,6 +220,14 @@ message StreamStop { uint32 stream_id = 1; }
|
||||
message StreamStateUpdate { uint32 user_id = 1; uint32 stream_id = 2; bool muted = 3; bool talking = 4; }
|
||||
message UdpBinding { bytes udp_token = 1; bool ack = 2; }
|
||||
|
||||
// Voice-plane subscription. Joining voice = you can hear and send voice in your channel;
|
||||
// leaving voice = the server stops relaying voice frames to you and you stop receiving.
|
||||
// Text chat is unaffected. The server toggles a per-session flag checked by the SFU relay's
|
||||
// recipient filter (docs/protocol.md §5). Result arrives as voice_subscription_result.
|
||||
message SubscribeVoiceRequest {}
|
||||
message UnsubscribeVoiceRequest {}
|
||||
message VoiceSubscriptionResult { bool ok = 1; string error = 2; bool subscribed = 3; }
|
||||
|
||||
// ── Text (ephemeral — server does not persist history, docs/protocol.md §5) ──────
|
||||
message TextMessage {
|
||||
TextScope scope = 1;
|
||||
|
||||
Reference in New Issue
Block a user