读了iOS/Android真实源码后修正:busy确实是真实的通话状态,之前判断错了

早前(Part I/K)判断"busy从未在持久化消息里真实出现过,只是本应用自己在
live信令上用的值",所以没把它并入 CallWebrtcState,只在本地 UI 状态单独
加了个 union。这次拿到手机端真实源码核对,iOS(ServerMessages.swift的7态
枚举)和Android(MsgServerData.java的BUSY)都把busy当成服务端下发的正式
head.webrtc取值之一,和accepted/finished等其余几个是同一级别的东西,
不是本应用凭空发明的——之前的判断依据不足。

补上 case 'busy' 的通话结果文案("对方忙线中",和已有的实时来电忙线提示
用词一致),去掉 stores/calls.ts 里两处不再需要的 `| 'busy'` 单独union。

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Your Name
2026-09-25 11:51:28 +08:00
co-authored by Claude Sonnet 5
parent 1d383b4e93
commit e7cb4edf3a
3 changed files with 20 additions and 12 deletions
+5 -6
View File
@@ -42,11 +42,10 @@ interface CallState {
// stays true even when the mic never actually attaches at all (permission denied/no device) -- a
// real user reported this as "看起来接通了" for a call where no audio ever worked on either side.
mediaJoined: boolean;
// `'busy'` is never a real PERSISTED `head.webrtc` value (confirmed live, see dispatch.ts's own
// comment) so it's deliberately NOT part of `CallWebrtcState` -- but it IS a real value this app's
// own `sendCallHangup(..., 'busy')` puts on the LIVE, ephemeral `{info hang-up}` signal a second
// caller receives, which flows straight into this same field.
endReason: CallWebrtcState | 'busy' | null;
// `busy` is now part of CallWebrtcState itself (2026-09-25: confirmed against real iOS/Android
// source that the server genuinely uses this value, not just this app's own live
// `sendCallHangup(..., 'busy')` signal a second caller receives) -- no separate union needed here.
endReason: CallWebrtcState | null;
/** Was THIS session the one that placed the call (via startCall), not the one that received it --
* needed to pick "已取消" vs "未接听" for the same wire value the same way dispatch.ts's
* callResultDisplay already does for the permanent chat-bubble record of the same call. */
@@ -65,7 +64,7 @@ interface CallState {
switchCamera: () => Promise<void>;
setHasRemoteVideo: (v: boolean) => void;
_reset: () => void;
_endWithReason: (reason: CallWebrtcState | 'busy') => void;
_endWithReason: (reason: CallWebrtcState) => void;
}
const IDLE = {