Fix sync CallEvent peerId for call link roomIds

This commit is contained in:
ayumi-signal 2024-10-16 10:01:09 -07:00 committed by GitHub
parent 63530f2eff
commit 1649808727
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 74 additions and 17 deletions

View file

@ -338,10 +338,13 @@ function shouldSyncStatus(callStatus: CallStatus) {
return statusToProto[callStatus] != null;
}
// For outgoing sync messages. peerId contains direct or group conversationId or
// call link peerId. Locally conversationId is Base64 encoded but roomIds
// are hex encoded.
export function getBytesForPeerId(callHistory: CallHistoryDetails): Uint8Array {
let peerId =
callHistory.mode === CallMode.Adhoc
? Bytes.fromBase64(callHistory.peerId)
? Bytes.fromHex(callHistory.peerId)
: uuidToBytes(callHistory.peerId);
if (peerId.length === 0) {
peerId = Bytes.fromBase64(callHistory.peerId);