fix(core): emit voice state from snapshots

This commit is contained in:
Edison Jwa
2026-05-20 14:52:34 +09:00
parent 3ae8e1ab77
commit 7473878136
+9
View File
@@ -666,6 +666,7 @@ impl ChanoraSession {
.await
.map(|(_, channel)| JoinChannelId(channel));
let epoch = state.join_state.authoritative.confirmed_epoch;
let before = channel_join::project(&state.join_state);
let _ = channel_join::reduce(
&mut state.join_state,
ChannelJoinEvent::SnapshotReady {
@@ -674,6 +675,14 @@ impl ChanoraSession {
now: std::time::Instant::now(),
},
);
let projection = channel_join::project(&state.join_state);
let should_emit_voice_state = projection != before;
self.voice_selector
.set_in_channel(projection.current_channel.is_some());
drop(guard);
if should_emit_voice_state {
self.emit_voice_state(projection).await;
}
Ok(snap)
}