From 624134ccc9727250f90fc8b726df28dd68276150 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Tue, 21 Jan 2025 10:57:59 +1100 Subject: [PATCH] fix: anything to 03 pubkey should be wrapped to envelope for group even if no one should care about it, android still does --- ts/session/sending/MessageWrapper.ts | 2 +- ts/session/utils/Messages.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ts/session/sending/MessageWrapper.ts b/ts/session/sending/MessageWrapper.ts index f519b478f..1077679a9 100644 --- a/ts/session/sending/MessageWrapper.ts +++ b/ts/session/sending/MessageWrapper.ts @@ -4,7 +4,7 @@ import { MessageEncrypter } from '../crypto/MessageEncrypter'; import { PubKey } from '../types'; function encryptionBasedOnConversation(destination: PubKey) { - if (ConvoHub.use().get(destination.key)?.isClosedGroup()) { + if (PubKey.is03Pubkey(destination.key) || ConvoHub.use().get(destination.key)?.isClosedGroup()) { return SignalService.Envelope.Type.CLOSED_GROUP_MESSAGE; } return SignalService.Envelope.Type.SESSION_MESSAGE; diff --git a/ts/session/utils/Messages.ts b/ts/session/utils/Messages.ts index 6355f65b0..985ee93c3 100644 --- a/ts/session/utils/Messages.ts +++ b/ts/session/utils/Messages.ts @@ -41,8 +41,9 @@ export async function toRawMessage( ): Promise { const ttl = message.ttl(); const plainTextBuffer = message.plainTextBuffer(); + const is03group = PubKey.is03Pubkey(destinationPubKey.key); - const encryption = getEncryptionTypeFromMessageType(message, isGroup); + const encryption = getEncryptionTypeFromMessageType(message, isGroup || is03group); const rawMessage: OutgoingRawMessage = { identifier: message.identifier,