Remove last use of Buffer in ringrtc API

Co-authored-by: Jim Gustafson <jim@signal.org>
This commit is contained in:
Miriam Zimmerman
2025-10-01 16:57:39 -04:00
committed by GitHub
parent 3b67d00c85
commit dd1b7e6fc1
14 changed files with 27 additions and 40 deletions

View File

@@ -27,7 +27,7 @@ export function callingMessageToProto(
if (opaque) {
opaqueField = {
...opaque,
data: bufferToProto(opaque.data),
data: opaque.data,
};
}
if (urgency !== undefined) {
@@ -43,14 +43,14 @@ export function callingMessageToProto(
...offer,
id: Long.fromValue(offer.callId),
type: offer.type as number,
opaque: bufferToProto(offer.opaque),
opaque: offer.opaque,
}
: undefined,
answer: answer
? {
...answer,
id: Long.fromValue(answer.callId),
opaque: bufferToProto(answer.opaque),
opaque: answer.opaque,
}
: undefined,
iceUpdate: iceCandidates
@@ -58,7 +58,7 @@ export function callingMessageToProto(
return {
...candidate,
id: Long.fromValue(candidate.callId),
opaque: bufferToProto(candidate.opaque),
opaque: candidate.opaque,
};
})
: undefined,
@@ -80,19 +80,6 @@ export function callingMessageToProto(
};
}
function bufferToProto(
value: Uint8Array | { toArrayBuffer(): ArrayBuffer } | undefined
): Uint8Array | undefined {
if (!value) {
return undefined;
}
if (value instanceof Uint8Array) {
return value;
}
return new Uint8Array(value.toArrayBuffer());
}
function urgencyToProto(
urgency: CallMessageUrgency
): Proto.CallMessage.Opaque.Urgency {