Remove unused code from WebAPI

This commit is contained in:
Fedor Indutny 2021-09-28 16:38:55 -07:00 committed by GitHub
parent cd710bb8d2
commit eec669f284
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 91 deletions

View file

@ -21,7 +21,7 @@ import {
UnidentifiedSenderMessageContent,
} from '@signalapp/signal-client';
import type { WebAPIType } from './WebAPI';
import type { WebAPIType, MessageType } from './WebAPI';
import { SendMetadataType, SendOptionsType } from './SendMessage';
import {
OutgoingIdentityKeyError,
@ -52,13 +52,6 @@ export type SendLogCallbackType = (options: {
deviceIds: Array<number>;
}) => Promise<void>;
type SendMetadata = {
type: number;
destinationDeviceId: number;
destinationRegistrationId: number;
content: string;
};
export const serializedCertificateSchema = z
.object({
expires: z.number().optional(),
@ -289,7 +282,7 @@ export default class OutgoingMessage {
async transmitMessage(
identifier: string,
jsonData: Array<unknown>,
jsonData: ReadonlyArray<MessageType>,
timestamp: number,
{ accessKey }: { accessKey?: string } = {}
): Promise<void> {
@ -419,7 +412,7 @@ export default class OutgoingMessage {
new Address(theirUuid, destinationDeviceId)
);
return window.textsecure.storage.protocol.enqueueSessionJob<SendMetadata>(
return window.textsecure.storage.protocol.enqueueSessionJob<MessageType>(
address,
async () => {
const protocolAddress = ProtocolAddress.new(
@ -494,7 +487,7 @@ export default class OutgoingMessage {
);
})
)
.then(async (jsonData: Array<SendMetadata>) => {
.then(async (jsonData: Array<MessageType>) => {
if (sealedSender) {
return this.transmitMessage(identifier, jsonData, this.timestamp, {
accessKey,