From 3a5af332f7770b1be7035c5d0d4fdcc1ac8a86fa Mon Sep 17 00:00:00 2001 From: Thomas Belin Date: Thu, 4 Jan 2024 11:37:59 +0100 Subject: [PATCH] fix: Remove outdated sendExternalJoinProposal method --- .../ConversationService.ts | 28 +------------------ .../mls/MLSService/MLSService.ts | 6 ---- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/packages/core/src/conversation/ConversationService/ConversationService.ts b/packages/core/src/conversation/ConversationService/ConversationService.ts index 6961a42935..af7cd2e75c 100644 --- a/packages/core/src/conversation/ConversationService/ConversationService.ts +++ b/packages/core/src/conversation/ConversationService/ConversationService.ts @@ -46,7 +46,6 @@ import logdown from 'logdown'; import {APIClient} from '@wireapp/api-client'; import {TypedEventEmitter} from '@wireapp/commons'; -import {Ciphersuite, CredentialType, ExternalProposalType} from '@wireapp/core-crypto'; import {GenericMessage} from '@wireapp/protocol-messaging'; import { @@ -60,7 +59,7 @@ import { import {MessageTimer, MessageSendingState, RemoveUsersParams} from '../../conversation/'; import {decryptAsset} from '../../cryptography/AssetCryptography'; -import {MLSService, optionalToUint8Array} from '../../messagingProtocols/mls'; +import {MLSService} from '../../messagingProtocols/mls'; import {isCoreCryptoMLSWrongEpochError} from '../../messagingProtocols/mls/MLSService/CoreCryptoMLSError'; import {getConversationQualifiedMembers, ProteusService} from '../../messagingProtocols/proteus'; import { @@ -422,31 +421,6 @@ export class ConversationService extends TypedEventEmitter { return this.mlsService.joinByExternalCommit(() => this.apiClient.api.conversation.getGroupInfo(conversationId)); } - /** - * Will send an external proposal for the current device to join a specific conversation. - * In order for the external proposal to be sent correctly, the underlying mls conversation needs to be in a non-established state - * @param groupId The conversation to join - * @param epoch The current epoch of the local conversation - */ - public async sendExternalJoinProposal(groupId: string, epoch: number) { - return sendMessage(async () => { - const groupIdBytes = Decoder.fromBase64(groupId).asBytes; - const externalProposal = await this.mlsService.newExternalProposal(ExternalProposalType.Add, { - epoch, - conversationId: groupIdBytes, - ciphersuite: Ciphersuite.MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519, - credentialType: CredentialType.Basic, - }); - await this.apiClient.api.conversation.postMlsMessage( - //@todo: it's temporary - we wait for core-crypto fix to return the actual Uint8Array instead of regular array - optionalToUint8Array(externalProposal), - ); - - //We store the info when user was added (and key material was created), so we will know when to renew it - await this.mlsService.resetKeyMaterialRenewal(groupId); - }); - } - /** * Will check if mls group exists locally. * @param groupId groupId of the conversation diff --git a/packages/core/src/messagingProtocols/mls/MLSService/MLSService.ts b/packages/core/src/messagingProtocols/mls/MLSService/MLSService.ts index 23c3b883ce..cbe5909f1a 100644 --- a/packages/core/src/messagingProtocols/mls/MLSService/MLSService.ts +++ b/packages/core/src/messagingProtocols/mls/MLSService/MLSService.ts @@ -36,8 +36,6 @@ import { CoreCrypto, CredentialType, DecryptedMessage, - ExternalAddProposalArgs, - ExternalProposalType, ProposalArgs, ProposalType, RemoveProposalArgs, @@ -287,10 +285,6 @@ export class MLSService extends TypedEventEmitter { return Encoder.toBase64(key).asString; } - public async newExternalProposal(externalProposalType: ExternalProposalType, args: ExternalAddProposalArgs) { - return this.coreCryptoClient.newExternalProposal(externalProposalType, args); - } - public async processWelcomeMessage(welcomeMessage: Uint8Array): Promise { return this.coreCryptoClient.processWelcomeMessage(welcomeMessage); }