fix: filter out logged-in user from call member pictures in all call states
The Offering, Ended, Connected, and PipConnected call states were showing the logged-in user's picture alongside other call members. IncomingCall and Connecting already filtered correctly. Now all states consistently exclude the current user via `- accountViewModel.account.signer.pubKey`. https://claude.ai/code/session_01PFzKU8Y3nUQXhshA3MT5EM
This commit is contained in:
@@ -132,11 +132,15 @@ fun CallScreen(
|
|||||||
}
|
}
|
||||||
|
|
||||||
is CallState.Offering -> {
|
is CallState.Offering -> {
|
||||||
|
val otherMembers =
|
||||||
|
remember(state.peerPubKeys) {
|
||||||
|
state.peerPubKeys - accountViewModel.account.signer.pubKey
|
||||||
|
}
|
||||||
if (isInPipMode) {
|
if (isInPipMode) {
|
||||||
PipCallUI(peerPubKeys = state.peerPubKeys, statusText = stringRes(R.string.call_calling), accountViewModel = accountViewModel)
|
PipCallUI(peerPubKeys = otherMembers, statusText = stringRes(R.string.call_calling), accountViewModel = accountViewModel)
|
||||||
} else {
|
} else {
|
||||||
CallInProgressUI(
|
CallInProgressUI(
|
||||||
peerPubKeys = state.peerPubKeys,
|
peerPubKeys = otherMembers,
|
||||||
statusText = stringRes(R.string.call_calling),
|
statusText = stringRes(R.string.call_calling),
|
||||||
accountViewModel = accountViewModel,
|
accountViewModel = accountViewModel,
|
||||||
onHangup = { scope.launch { callManager.hangup() } },
|
onHangup = { scope.launch { callManager.hangup() } },
|
||||||
@@ -202,9 +206,13 @@ fun CallScreen(
|
|||||||
}
|
}
|
||||||
|
|
||||||
is CallState.Ended -> {
|
is CallState.Ended -> {
|
||||||
|
val otherMembers =
|
||||||
|
remember(state.peerPubKeys) {
|
||||||
|
state.peerPubKeys - accountViewModel.account.signer.pubKey
|
||||||
|
}
|
||||||
if (!isInPipMode) {
|
if (!isInPipMode) {
|
||||||
CallInProgressUI(
|
CallInProgressUI(
|
||||||
peerPubKeys = state.peerPubKeys,
|
peerPubKeys = otherMembers,
|
||||||
statusText = stringRes(R.string.call_ended),
|
statusText = stringRes(R.string.call_ended),
|
||||||
accountViewModel = accountViewModel,
|
accountViewModel = accountViewModel,
|
||||||
onHangup = { onCallEnded() },
|
onHangup = { onCallEnded() },
|
||||||
@@ -451,6 +459,10 @@ private fun ConnectedCallUI(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If no video or peer stopped sharing, show avatar
|
// If no video or peer stopped sharing, show avatar
|
||||||
|
val otherMembers =
|
||||||
|
remember(state.allPeerPubKeys) {
|
||||||
|
state.allPeerPubKeys - accountViewModel.account.signer.pubKey
|
||||||
|
}
|
||||||
if (!isRemoteVideoActive) {
|
if (!isRemoteVideoActive) {
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier.fillMaxSize(),
|
modifier = Modifier.fillMaxSize(),
|
||||||
@@ -458,13 +470,13 @@ private fun ConnectedCallUI(
|
|||||||
verticalArrangement = Arrangement.Center,
|
verticalArrangement = Arrangement.Center,
|
||||||
) {
|
) {
|
||||||
GroupCallPictures(
|
GroupCallPictures(
|
||||||
peerPubKeys = state.allPeerPubKeys,
|
peerPubKeys = otherMembers,
|
||||||
size = 120.dp,
|
size = 120.dp,
|
||||||
accountViewModel = accountViewModel,
|
accountViewModel = accountViewModel,
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
GroupCallNames(
|
GroupCallNames(
|
||||||
peerPubKeys = state.allPeerPubKeys,
|
peerPubKeys = otherMembers,
|
||||||
accountViewModel = accountViewModel,
|
accountViewModel = accountViewModel,
|
||||||
textColor = Color.White,
|
textColor = Color.White,
|
||||||
)
|
)
|
||||||
@@ -690,6 +702,10 @@ private fun PipConnectedCallUI(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val otherMembers =
|
||||||
|
remember(state.allPeerPubKeys) {
|
||||||
|
state.allPeerPubKeys - accountViewModel.account.signer.pubKey
|
||||||
|
}
|
||||||
if (!isRemoteVideoActive) {
|
if (!isRemoteVideoActive) {
|
||||||
// Show small avatar + timer in PiP
|
// Show small avatar + timer in PiP
|
||||||
Column(
|
Column(
|
||||||
@@ -698,7 +714,7 @@ private fun PipConnectedCallUI(
|
|||||||
verticalArrangement = Arrangement.Center,
|
verticalArrangement = Arrangement.Center,
|
||||||
) {
|
) {
|
||||||
GroupCallPictures(
|
GroupCallPictures(
|
||||||
peerPubKeys = state.allPeerPubKeys,
|
peerPubKeys = otherMembers,
|
||||||
size = 48.dp,
|
size = 48.dp,
|
||||||
accountViewModel = accountViewModel,
|
accountViewModel = accountViewModel,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user