mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-23 09:58:12 +01:00
Update libsignal-client to 0.76.0
This commit is contained in:
@@ -47,7 +47,7 @@ export abstract class CDSSocketBase<
|
||||
|
||||
protected readonly logger: LoggerType;
|
||||
|
||||
protected readonly socketIterator: AsyncIterator<Buffer>;
|
||||
protected readonly socketIterator: AsyncIterator<Uint8Array>;
|
||||
|
||||
constructor(protected readonly options: Options) {
|
||||
super();
|
||||
@@ -87,18 +87,18 @@ export abstract class CDSSocketBase<
|
||||
);
|
||||
|
||||
const request = Proto.CDSClientRequest.encode({
|
||||
newE164s: Buffer.concat(
|
||||
newE164s: Bytes.concatenate(
|
||||
e164s.map(e164 => {
|
||||
// Long.fromString handles numbers with or without a leading '+'
|
||||
return new Uint8Array(Long.fromString(e164).toBytesBE());
|
||||
})
|
||||
),
|
||||
aciUakPairs: Buffer.concat(aciUakPairs),
|
||||
aciUakPairs: Bytes.concatenate(aciUakPairs),
|
||||
returnAcisWithoutUaks,
|
||||
}).finish();
|
||||
|
||||
log.info(`CDSSocket.request(): sending version=${version} request`);
|
||||
await this.sendRequest(version, Buffer.from(request));
|
||||
await this.sendRequest(version, request);
|
||||
|
||||
const resultMap: Map<string, CDSResponseEntryType> = new Map();
|
||||
|
||||
@@ -129,9 +129,14 @@ export abstract class CDSSocketBase<
|
||||
|
||||
public abstract handshake(): Promise<void>;
|
||||
|
||||
protected abstract sendRequest(version: number, data: Buffer): Promise<void>;
|
||||
protected abstract sendRequest(
|
||||
version: number,
|
||||
data: Uint8Array
|
||||
): Promise<void>;
|
||||
|
||||
protected abstract decryptResponse(ciphertext: Buffer): Promise<Buffer>;
|
||||
protected abstract decryptResponse(
|
||||
ciphertext: Uint8Array
|
||||
): Promise<Uint8Array>;
|
||||
|
||||
// EventEmitter types
|
||||
|
||||
@@ -161,7 +166,7 @@ export abstract class CDSSocketBase<
|
||||
// Private
|
||||
//
|
||||
|
||||
#iterateSocket(): AsyncIterator<Buffer> {
|
||||
#iterateSocket(): AsyncIterator<Uint8Array> {
|
||||
const stream = new Readable({ read: noop, objectMode: true });
|
||||
|
||||
this.socket.on('message', ({ type, binaryData }) => {
|
||||
|
||||
Reference in New Issue
Block a user