mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-27 03:43:27 +01:00
Remove last use of Buffer in ringrtc API
Co-authored-by: Jim Gustafson <jim@signal.org>
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user